Simple #if/#else example : if def « Macro Preprocessor « C / ANSI-C






Simple #if/#else example


#include <stdio.h>

#define MAX 10

int main(void)
{
#if MAX>99
  printf("Compiled for array greater than 99.\n");
#else
  printf("Compiled for small array.\n");
#endif 

  return 0;
}


           
       








Related examples in the same category

1.Simple #if example
2.#define, #ifdef #else example
3.#define and #ifdef