w1coding.comAll tutorials

C Environment Setup

C lessons
  1. Environment Setup
  2. Introduction
  3. Variables
  4. Operators
  5. Condition
  6. Loops
  7. Functions
  8. Arrays
  9. Pointers
  10. Strings
  11. Struct
  12. File
  13. Memory
  14. Recursions
  15. Bitwise
  16. Directives
  17. Commandline
  18. Switch
  19. Enum
  20. Structp
  21. Arraysofstr
  22. Macros
  23. Pointer Arrays
  24. Linked
  25. Stack
  26. Queue
  27. Graph

Set up an editor, a C compiler and a terminal. The compiler translates your C source into an executable for your operating system.

What you need

  • GCC or another C compiler
  • A text editor
  • A terminal

Set up your environment

  1. Install VS Code if desired, then install a compiler separately. The C/C++ editor extension does not supply a compiler.
  2. On Windows follow the official VS Code MinGW/MSYS2 guide. Install the UCRT64 toolchain and add its bin folder to PATH as documented. On Linux use your distribution compiler packages; on macOS install the command-line developer tools.
  3. Reopen the terminal and verify gcc --version. Create a practice folder and save the file there.
  4. Compile from the folder containing the source file, then run the executable. The commands below show a Windows terminal. On Linux/macOS choose an output name without .exe and run it with ./hello.

Your first check

Save as hello.c

#include <stdio.h>
int main(void) {
    printf("Hello from w1coding.com\n");
    return 0;
}

Run or verify

gcc hello.c -o hello.exe
.\hello.exe

Expected result: The terminal prints Hello from w1coding.com.

Common setup problems

  • If gcc is not recognised, check the compiler installation and PATH, then open a new terminal.
  • Save C files with the .c extension. Compilation errors must be fixed before running the program.

Official documentation

Guide reviewed 17 November 2026. Check the linked vendor documentation for current supported versions and operating systems.