June 2025
Intermediate to advanced
1093 pages
33h 24m
English
For clarity, Table 21.1 lists the most important preprocessor directives once again. I have added a few more with a brief explanation.
|
Directive |
Explanation |
|---|---|
|
#include |
Include another file |
|
#define |
Define identifier or macro |
|
#undef |
Remove identifier definition |
|
#ifdef |
Check if a preprocessor identifier is defined |
|
#ifndef |
Check if a preprocessor identifier is not defined |
|
#elifdef |
Alternative check if an identifier is defined (C++23) |
|
#elifndef |
Alternative check if an identifier is not defined (C++23) |
|
#if |
Check preprocessor expression |
|
#else |
Alternative source code to one of the preprocessor ifs |
|
#elif |
Alternative source code and another check |
|
#endif |
End of the ... |
Read now
Unlock full access