Compile & Run in C
From the C cheat sheet · Getting Started · verified Jul 2026
Compile & Run
Build with warnings and a modern standard.
c
// Quick Reference
gcc -std=c23 -Wall main.c -o main
./main💡 -Wall -Wextra catch most beginner bugs at compile time - always compile with them.
⚡ Pass -std=c23 (or c17) explicitly; the compiler default may be an older dialect.
📌 Build with -g and run under valgrind to catch memory leaks and invalid access.
🟢 C compiles ahead of time to a native binary - there is no runtime/interpreter.
compilecli