XV, macros, conditional compilation, and enumeration

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.