Learn C Programming

Lesson 1 of 8 · The Preprocessor, Headers and Multi File Builds

Module 15 · The Preprocessor, Headers and Multi File Builds

The Preprocessor: What Happens Before the Compiler

ProReading

Maria's tax program is 12 lines long. She asks a simple question: what does the compiler actually see?

Checking what this lesson needs for you…

What is inside The Preprocessor: What Happens Before the Compiler

  1. The steps before the compiler
  2. gcc -E shows the file the compiler reads
  3. #include pastes a whole file in
  4. #define, through the preprocessor's eyes
  5. Conditional compilation: #if, #ifdef and #ifndef
  6. Predefined macros: the compiler describes itself
  7. assert is a macro built from them
  8. #error and #warning talk to the build