Get Latest Exam news, Private & Government Job Alerts and Free Study Materials for Exam preparations.

What is Preprocessor in C Language?

The C Preprocessor is a macro processor that commands the compiler to do required pre-processing before the actual compilation begins. All Preprocessor Commands begin with # Symbol.

The Preprocess actually process the source code before it is compiled by the compiler.

Examples of C Preprocessor

  1. #include [Inserts a particular header from another file]
  2. #define [Substitutes a preprocessor macro]
  3. #undef [Undefines a preprocessor macro]
  4. #ifdef [Returns true if this macro is defined]
  5. #ifndef [Returns true if this macro is not defined.]
  6. #if [Tests if a compile time condition is true.]
  7. #else [The alternative for #if]
  8. #elif [else and #if in one statement.]
  9. #endif – [Ends preprocessor conditional]
  10. #error – [Prints error message on stderr]
  11. #pragma [Issues special commands to the compiler, using a standardized method]