1. Macros① no macros #define MAX ② macros are precompiled when you replace them③ Plain capitalization definition macrosThe main function of the ④ macro is to replacethe use of ⑤ macros makes the program easier to modify2. Conditional compilation① function: Compile different code according to different conditions② typically uses conditional compilation to debug code . ③ conditional compilation in the compiler, depending on the conditions, compiling different source code④if is the run time, depending on whether the condition is satisfied, execute the corresponding code. ⑤ Three types of conditional compilation:form one:#ifdefIdentifier
Code Snippet 1
#else
Code Snippet 2 #endif if identifiers are over, compiler compiled code snippet 1 otherwise compile the snippet 2 form two:#ifndefIdentifier
Code Snippet 1
#else
Code Snippet 2 #endif if The identifier was not over, compiler compiled code snippet 1 otherwise compile the snippet 2 Form Three:#if constant expression code snippet #else
code snippet 2 #endif3. Enumeration type① enumeration belongs to constructed type②enum Enumeration name { enumeration value table }; ③ Enumeration Values table all possible results are listed in ROM④ enumerations are widely used in programs and are commonly used for switch...case statements the ⑤ default value starts at 0 . Support typedef ⑥ Core Role: To understand the human identifier and the computer to understand the relationship between the number building⑦enum season{Spring,Summer,Autumn,Winter }⑧ to the initial value is the initial value, not to be based on the above self-increment
XV, macros, conditional compilation, and enumeration