# C compiler preprocessors

Preprocessor commands are executed before the compiler compiles the source code. These commands will change the original code usually to suit the operating environment and/or to add code that will be required by calls to library functions. Preprocessors are recognised by the leading # in their names.

Preprocessors
#include | Insert a source file.
#define | Define a preprocessor constant.
#if | Branch based on an expression.
#ifdef | Branch if preprocessor constant has been defined?
#ifndef | Branch is a preprocessor constant has NOT been defined.
#line | Specify the number of the next source line.
#undef | Remove a preprocessor constant.
#pragma | Perform an implementation dependent action???
#else | Executed if #if #ifdef or #ifndef fails.
#error | Write an error message.
#elif | Executed when an #if fails.
#endif | Close #if #ifdef or #ifndef

## Notes:

- Preprocessors should start in column 1.
- The -E option tells gcc to stop after the preprocessor stage and send the O/P to STDOUT (usually the screen).

Top | Master Index | Keywords | Functions