#else directive sets an alternative if #if fails. - C Preprocessor

C examples for Preprocessor:Preprocessor Operators

Description

#else directive sets an alternative if #if fails.

Demo Code

#include <stdio.h>

#define MAX 10//from  w w  w. j a  v a  2 s  .c o m

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

   return 0;
}

Result


Related Tutorials