Preprocessor Directives
Essay by Marry • January 20, 2012 • Essay • 329 Words (2 Pages) • 1,440 Views
My Training Period: hours
Abilities
▪ Able to understand and use #include.
▪ Able to understand and use #define.
▪ Able to understand and use macros and inline functions.
▪ Able to understand and use the conditional compilation - #if, #endif, #ifdef, #else,
#ifndef and #undef.
▪ Able to understand and use #error, #pragma, # and ## operators and #line.
▪ Able to display error messages during conditional compilation.
▪ Able to understand and use assertions.
10.1 Introduction
- For C/C++ preprocessor, preprocessing occurs before a program is compiled. A complete process
involved during the preprocessing, compiling and linking can be read in Module W.
- Some possible actions are:
▪ Inclusion of other files in the file being compiled.
▪ Definition of symbolic constants and macros.
▪ Conditional compilation of program code or code segment.
▪ Conditional execution of preprocessor directives.
- All preprocessor directives begin with #, and only white space characters may appear before a
preprocessor directive on a line.
10.2 The #include Preprocessor Directive
- The #include directive causes copy of a specified file to be included in place of the directive. The
two forms of the #include directive are:
...
...