The compiler turns your text into a program.
Direct answer
Compile a C file with gcc main.c -o app and run it with ./app. Add -Wall -Wextra to see warnings, -g to include debugging information and list multiple files to compile them together.
Common commands
gcc main.c -o app
gcc -Wall -Wextra -g main.c -o app
gcc main.c utils.c -o app
./app
Useful flags
| Flag | Meaning |
|---|---|
-Wall -Wextra | more warnings |
-g | debugging info |
-O2 | optimise |
-std=c11 | choose the language standard |
-fsanitize=address | catch memory errors |
What happens during compile
- Preprocessing: handles
#includeand#define. - Compiling: turns C into assembly.
- Assembling: creates object files.
- Linking: joins objects and libraries.
Windows
Install MinGW-w64 or use WSL to get GCC.
Where Teyro fits
Teyro's C for Beginners course turns this into short lessons you can play in a few minutes a day. It has 78 lessons, and you can start free.
The bottom line
Always compile with warnings on and read them.



