C++ programs, like C programs, consist of one or more files. Each of these files is translated in the following conceptual order (the actual order follows the “as if” rule: translation must occur as if these steps had been followed):
Preprocessor directives always begin with the number-sign (#) character (that is, the first nonwhite-space character on the line must be a number sign). Only one preprocessor directive can appear on a given line. For example:
#include <iostream.h> // Include text of iostream.h in
// translation unit.
#define NDEBUG // Define NDEBUG (NDEBUG contains empty
// text string).
During this phase, syntactic and semantic checking of the source code is performed.
See Phases of Translation in the Preprocessor Reference for more information.
The C++ preprocessor is a strict superset of the ANSI C preprocessor, but the C++ preprocessor differs in a few instances. The following list describes several differences between the ANSI C and the C++ preprocessors: