Quiz Entry - updated: 2026.07.07
What does the C preprocessor do?
It textually expands #includes and #define macros, emitting one large preprocessed source file before real compilation begins.
$ gcc -E p24.c > p24.pp.c
Before preprocessing:
#include <stdio.h>
#define N 1024
int main() {
int A[N];
...
}
After preprocessing:
// Contents of stdio.h inserted here
int main() {
// N replaced with 1024
int A[1024];
...
}
The preprocessed file can be much larger (e.g., 270 bytes -> 48KB) due to included headers.
Go deeper:
The C Preprocessor: Macros (GCC docs) — authoritative reference on object-like vs function-like macros, stringizing and concatenation.
C preprocessor (Wikipedia) — a broader tour of #include, macros, include guards, conditional compilation and the classic macro pitfalls.