Sometimes you get an inscrutable error and have no idea why the compiler is complaining. Or you may have code that looks reasonable and compiles OK, but it behaves in a way that defies sanity even when you take the phase of the moon into account. This is a good time to examine the preprocessor’s output so you can see exactly what the compiler is seeing. The -E flag tells gcc to send the preprocessed source code to standard out. You can use Xcode 3’s Preprocess command as well, or Xcode 4’s generated output.
Example 2.2 looks simple enough. It will read a line from standard in and print it back out.
Example 2.2. preprocTest.m
// preprocTest.m -- a program to show preprocessor ...