A structured lesson workspace with readable content, hands-on examples, and a clean path to completion.
You cannot write C without a compiler. That sounds obvious, but I have watched dozens of students stare at a blank VS Code window for an hour because nobody told them the actual sequence: install compiler, add to PATH, verify, then configure the editor. So that is exactly what we will do here, in order, with no hand-waving.
Three things. A C compiler (we will use MinGW-w64, which gives you GCC on Windows), a text editor (VS Code with the C/C++ extension), and a terminal that can find your compiler. That is it. No IDE required. No Visual Studio 40 GB install. If someone tells you that you need Visual Studio to write C, they are confusing C with C++ project templates.
MSYS2 gives you a package manager (pacman) that pulls pre-built GCC binaries. Once MSYS2 is installed, open the MSYS2 terminal from your Start menu and install the toolchain.
Add C:\msys64\mingw64\bin to your system PATH. Open System Properties > Environment Variables > edit Path under System variables > New > paste that directory. Close and reopen your terminal afterward or the change will not take effect.
Open a fresh Command Prompt or PowerShell window. Type the following. If you get a version string, you are done with the compiler half.
Now write a throwaway program. Create a file called hello.c on your Desktop with the following content, then compile and run it from the same directory.
#include <stdio.h>int main(void) {printf("Environment is working.\n");return 0;}
No output means success. GCC only speaks when something goes wrong. Run the binary.
Install the "C/C++" extension by Microsoft from the VS Code marketplace. Then create a .vscode folder in your project directory with a tasks.json that calls gcc. This gives you Ctrl+Shift+B to build without leaving the editor.
{"version": "2.0.0","tasks": [{"label": "build C","type": "shell","command": "gcc","args": ["${file}","-o","${fileDirname}/${fileBasenameNoExtension}.exe","-Wall","-g"],"group": {"kind": "build","isDefault": true},"problemMatcher": ["$gcc"]}]}
The -Wall flag turns on all common warnings. The -g flag embeds debug symbols so you can step through code with GDB later. Get into the habit of always compiling with both from day one. Future-you, debugging a segfault at 2 AM, will be grateful.
That is the entire setup. Compiler installed, PATH configured, editor wired up, first program compiled and executed. Every single lesson from here forward assumes this environment exists. If you are on macOS, the next lesson covers your equivalent using Xcode Command Line Tools and clang.
Finish the lesson once you have worked through the material. This awards ★ 10 XP.