#elif Directive

This page was translated by a robot.

The #elifdirective initiates the start of another condition after a previous conditional compilation. The block of code from the preceding #if, , #elif, #ifdefor #ifndefdirective completes.








Very large array
#include <stdio.h>
#define ARRAY_SIZE 10000000

int main(){
  #if ARRAY_SIZE > 1000
    printf("Large array\n");
  #elif ARRAY_SIZE > 100000
    printf("Very large array\n");
  #endif
  return 0;
}

Details

Any number #elifof directives can appear within a conditional compilation.