Preprocessor
What is preprocessor?
参见:
1、wikipedia Preprocessor
2、microsoft C/C++ preprocessor reference
cppreference Preprocessor
The preprocessor is executed at translation phase 4, before the compilation. The result of preprocessing is a single file which is then passed to the actual compiler.
Directives and Capabilities
preprocessing instruction
NOTE: 预编译指令,它们都是以
#
打头的,下面是对它们的分类
Capabilities | Directive | |
---|---|---|
Conditional inclusion | #if , #ifdef , #ifndef , #else , #elif and #endif |
|
Replacing text macros | 1) #define and #undef 2) # and `## |
|
Source file inclusion | include , __has_include (since C++17) |
|
Error directive | error , |
|
Implementation defined behavior control | pragma , _Pragma (since C++11) |
|
Filename and line information | line , |
[1]