Directives to the Preprocessor
Visual Studio 2015
The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.
The latest version of this topic can be found at Directives to the Preprocessor.
A "directive" instructs the C preprocessor to perform a specific action on the text of the program before compilation. Preprocessor directives are fully described in the Preprocessor Reference. This example uses the preprocessor directive #define:
#define MAX 100
This statement tells the compiler to replace each occurrence of MAX by 100 before compilation. The C compiler preprocessor directives are:
| #define | #endif | #ifdef | #line |
|---|---|---|---|
#elif | #error | #ifndef | #pragma |
#else | #if | #include | #undef |
Show: