#if ... # endif usage summary #if ... # endif usage summary

Reference: https: //www.cnblogs.com/lihuidashen/p/3485401.html

#if ... # endif usage summary

 

  When written pwm scale program in the code have #if ... # endif usage issues related to the scale of the code is as follows:

yinjie

Here the author is saying #if ... # endif of usage;

#if ... # endif is kind of condition C ++ preprocessor commands available in two formats:

1: #ifdef identifier      

  Block 1      

#else         

  Block 2     

#endif 

Said: If the identifier has been defined through #define command, the compiler paragraph 1, otherwise the compiler paragraph 2

2: #if Expression      

   Block 1    

#else         

  Block 2    

#endif

He said: If the expression is true, the compiler paragraph 1, section 2 or the compiler.

You write command should belong Format 1

  It means that if no #defined ** ** been defined in the program. The following statement is compiled, otherwise it does not compile. This is the case of multiple use on the need for frequent transplant program modules, or when debugging with.

  #If combination with # else, # elif, # endif, # define #undef instructions and may be included or excluded in accordance with one or more of the code symbol is present. When compiling debug version of the code or compiled for a particular configuration, it would be useful.

#If conditional instructions to begin instruction must explicitly terminated with #endif instruction.

#define allows you to define a symbol, the symbol used to pass through instructions #if expression so that the expression evaluates to true.

You can also use the / define compiler option to define symbols. #Undef can define the symbol to cancel.

With / define symbols or #define defined variable with the same name does not conflict. That is, the variable name should not be passed to the pre-processor instructions, and the symbol can only be calculated with a pre-processor instruction.

The signed range is created with the #define definition file in which the symbol.

 

  When written pwm scale program in the code have #if ... # endif usage issues related to the scale of the code is as follows:

yinjie

Here the author is saying #if ... # endif of usage;

#if ... # endif is kind of condition C ++ preprocessor commands available in two formats:

1: #ifdef identifier      

  Block 1      

#else         

  Block 2     

#endif 

Said: If the identifier has been defined through #define command, the compiler paragraph 1, otherwise the compiler paragraph 2

2: #if Expression      

   Block 1    

#else         

  Block 2    

#endif

He said: If the expression is true, the compiler paragraph 1, section 2 or the compiler.

You write command should belong Format 1

  It means that if no #defined ** ** been defined in the program. The following statement is compiled, otherwise it does not compile. This is the case of multiple use on the need for frequent transplant program modules, or when debugging with.

  #If combination with # else, # elif, # endif, # define #undef instructions and may be included or excluded in accordance with one or more of the code symbol is present. When compiling debug version of the code or compiled for a particular configuration, it would be useful.

#If conditional instructions to begin instruction must explicitly terminated with #endif instruction.

#define allows you to define a symbol, the symbol used to pass through instructions #if expression so that the expression evaluates to true.

You can also use the / define compiler option to define symbols. #Undef can define the symbol to cancel.

With / define symbols or #define defined variable with the same name does not conflict. That is, the variable name should not be passed to the pre-processor instructions, and the symbol can only be calculated with a pre-processor instruction.

The signed range is created with the #define definition file in which the symbol.

Guess you like

Origin www.cnblogs.com/MCSFX/p/10958790.html