12.1. Definitions
The preprocessor is a part of the C++ compiler that modifies the source code of a program seen by the rest of the compiler; thus, the name "preprocessor". The preprocessor is needed to accomplish tasks that cannot be done by the rest of the compiler, e.g., to prevent declarations in a header file from being processed twice for the same implementation file.
A preprocessor directive is a command by which we tell the preprocessor to perform a specific task, e.g., to ignore a section of source code under certain conditions.
A preprocessor symbol is a constant value similar to a const that is known only to the preprocessor, not to the rest of the compiler. The rules for naming preprocessor symbols are the same as those for other identifiers, but it is customary to use all uppercase letters in preprocessor symbols so that they can be readily distinguished from other identifiers.
The #ifndef preprocessor directive tells the preprocessor to check whether a particular preprocessor symbol has been defined. If not, the following source code is treated normally; if it has been defined, the following source code is skipped by the rest of the compiler as though it were not present in the source file.
The #endif preprocessor directive terminates a section of source code controlled by a #ifndef or other conditional preprocessor directive.
|
www.steveheller.com steve@steveheller.com |