Small details of the use of macro definitions in C

  • 2020-04-01 23:31:45
  • OfStack

Details of #pragma#pragma preprocessing instructions
Of all the preprocessing instructions, the #Pragma instruction is probably the most complex, which sets the compiler's state or instructs it to perform certain actions. The #pragma directive gives each compiler a way to give host - or operating system-specific features while remaining fully compatible with the C and C++ languages. By definition, compilation indicators are proprietary to the machine or operating system and are different for each compiler.
Its format is generally: #Pragma Para
. The etc..

baike.baidu.com/view/1451188.htm

= = = = = = = = = = = = = = = = = = = = = = =

Two ways to force a function instead of a macro definition:

1: # undef isalpha

It appears before isalpha() and is still included at the top of the file < Ctype. H > .can force the compiler to use function definitions.

2: isalpha) (c)

The preprocessor does not treat this structure as a macro, but as a function call


Related articles: