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?

Pro lesson

This one goes deeper

It is included with this track and with Learn Pro. Every question on the Skill Test can be answered from the free lessons, so this is depth and never a gate on the certificate.

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