Using #ifdef, #ifndef, and #endif

Thursday, November 13, 2014
/* 2302.c: Using #ifdef, #ifndef, and #endif */
#include <stdio.h>

#define UPPER_CASE 0
#define NO_ERROR 0

main(void)
{
    #ifdef UPPER_CASE
    printf("THIS LINE IS PRINTED OUT,\n");
    printf("BECAUSE UPPER_CASE IS DEFINED.\n");
    #endif
    #ifndef LOWER_CASE
    printf("\nThis line is printed out,\n");
    printf("because LOWER_CASE is not defined.\n");
    #endif

    return NO_ERROR;
}

Copyright @ 2015 Tron!

Labels