- The C preprocessor is a program that processes our source program before it is passed to the compiler.
- preprocessor is a separate program which transforms C source code containing preprocessor directives into source code with the directives removed.
- The preprocessor is implemented as an integral part of an Standard C compiler.
- gcc -E filename will show the preprocessed file.
- Preprocessor commands are known as directives.
- Preprocessor works on a line by line basis.
- The preprocessor doesn't know about the scope rules of C. Preprocessor directives like
#define
take effect as soon as they are seen and remain in effect until the end of the file that contains them
- The preprocessor commands are called as directives.
- Each of these preprocessor directives begin with a # symbol.
- The directives can be placed anywhere in a program but they are most often placed at the beginning of a program.
- The preprocessor directives are classified in to 4 major categories
- Macro Expansion(#define)
- File Inclusion(#include)
- Conditional Compilation
- Miscellaneous directives
- The 2 most frequently used features are #include,to include the contents of a file during compilation and #define ,to replace a token by an arbitrary sequence of characters.
0 comments:
Post a Comment