Every C/C++ programmer knows that before a program is compiled, the preprocessor parses directives like
#define and macros and inserts them into the code, where they are used. But do you know how to see the preprocessor output? Did you know that’s even possible?
gcc -E file.c
g++ -E file.cpp
will do this for you. The
-E switch forces the compiler to stop after the preprocessing phase, spitting all it’s got at the moment to standard output.
Note: Surely you must have some
#include directives. The included files get preprocessed, too, so you might get lots of output.