ifdef preprocessor : Preprocessor IF « Macro Preprocessor « C / ANSI-C






ifdef preprocessor

#include <stdio.h>

#define DOG

int main(void)
{
#ifdef DOG
  printf("DOG is defined.\n");
#endif

#undef DOG

#ifdef DOG
  printf("This line is not compiled.\n");
#endif

  return 0;
}


           
       








Related examples in the same category

1.#IF #ELSE #ENDIF
2.IF and endif preprocessor