Pretreatment

xiaoxiao2021-04-05  261

# IF, # Elif, # Else and #Endif instructions are controlled by preprocessing expressions (Section 2.5.1) and conditional compilation symbols.

Conditional-symbol: (condition symbol :)

Any identifier or keyword other than True and False

There are two possible states of conditional compilation symbols: Defined or undefined. At the beginning of the source file lexical processing, the conditional compilation symbols are undefined unless the external mechanism (such as the command line compiler option) is explicitly defined, otherwise it is undefined. When processing #define instructions, the conditional compile symbol specified in the instruction is defined in that source file. Thereafter, the symbol has kept the defined state until a #undef instruction regarding the same symbol is processed, or the end of the source file. This means that there is no impact on the #define and #ndef instructions in a source file. There is no impact on other source files in the same program.

When referenced in the pre-processed expression, the defined conditional compilation symbol has a Boolean True, and the undefined conditional compilation symbol has a Boolean value FALSE. It is not required to explicitly declare them before the quote is compiled in the pretreatment expression. Instead, the unlessformed symbols are not defined, so there is a value FALSE.

Conditional compilation symbols Namespaces are very different from all other named entities in the C # program. Conditional compilation symbols can only be referenced in the #define and #undef instructions and pre-processing expressions.

转载请注明原文地址:https://www.9cbs.com/read-131997.html

New Post(0)