Both C and C++ source code passes through a stage called preprocessing. This process is performed by a tool called the preprocessor, before the code is compiled by the compiler.
Preprocessing is done automatically. You don't have to explicitly invoke the preprocessor. Also, it simply modifies the source code as seen by the compiler. The preprocessor does not touch your actual source code file except to read it. So when I say the preprocessor "deletes comments and replaces them with a space" and things like that, it means that if there is a comment in your source file (the input to the preprocessor) then the source that the compiler sees will have a space in that position. It does not mean that the source file stored on your hard drive is edited.
The preprocessing step is a relatively simple process of text substitution. Basically it performs the following actions:
It is important to realize that preprocessing is entirely done before the meaning of the source code itself is examined at all by the compiler. Using the #define directive is not like defining a variable, and a macro is not a function.
Preprocessing directives are indicated by lines starting with the 'sharp' symbol #. Each preprocessing directive occupies a single line (but keep in mind the line splicing performed by the preprocessor as mentioned above).