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 #define preprocessor directive defines a preprocessor symbol.

The #endif preprocessor directive terminates a section of source code controlled by a #ifndef or other conditional preprocessor directive.

An include guard is a mechanism to prevent a class definition from being included in a source code file more than once.

A default argument is a method of specifying a value for an argument to a function when the user of the function hasn't supplied a value for that argument. The value of the default argument is specified in the declaration of the function.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset