C Preprocessor Conditional Compilation Directives

  • In C Preprocessor Conditional Compilation Directives, depends on the condition block name to be pass from compilation process or not which is decided that the time of preprocessing.
  • If the condition is true, then block will be passed from compilation process. If condition is false then complete block of the statements will be removed from the source at the time of preprocessor.


void main()
printf(“Welcome “);
#if 5>8
printf(“to K2schools”);

K Welcome to K2schools

  • In the above program at the time of preprocessing condition became false so automatically correspondent block will be removed from the source and it pass to compilation.
  • By using conditional compilation preprocessor we can reduce the size of exe file because at the time of preprocessing by removing the statements it reduce obj file size then automatically exe file size reduced
  • .

Powered by k2schools