Preprocessor Directives in C Program

07-11-17 Course- C

 

Preprocessor C is a microprocessor used by the compiler to transform your code before compilation. It is called micro preprocessor because it allows us to add macros.

Note: Proprocessor direcives are executed before compilation.

C preprocessor

All preprocessor directives starts with hash # symbol.

Let's see a list of preprocessor directives.

  • #include
  • #define
  • #undef
  • #ifdef
  • #ifndef
  • #if
  • #else
  • #elif
  • #endif
  • #error
  • #pragma