cpp: Macros

1 
1 3 Macros
1 ********
1 
1 A "macro" is a fragment of code which has been given a name.  Whenever
1 the name is used, it is replaced by the contents of the macro.  There
1 are two kinds of macros.  They differ mostly in what they look like when
1 they are used.  "Object-like" macros resemble data objects when used,
1 "function-like" macros resemble function calls.
1 
1    You may define any valid identifier as a macro, even if it is a C
1 keyword.  The preprocessor does not know anything about keywords.  This
1 can be useful if you wish to hide a keyword such as 'const' from an
1 older compiler that does not understand it.  However, the preprocessor
1 operator 'defined' (⇒Defined) can never be defined as a macro,
1 and C++'s named operators (⇒C++ Named Operators) cannot be macros
1 when you are compiling C++.
1 

Menu