#ifndef means if not defined - C Preprocessor

C examples for Preprocessor:Preprocessor Operators

Description

#ifndef means if not defined

Demo Code

#include <stdio.h>
#define TED 10//from  w  w  w  .  j  a  va  2  s  . co  m
int main(void)
{
#ifdef TED
   printf("Hi Ted\n");
#else

   printf("Hi anyone\n");
#endif
#ifndef RALPH
   printf("RALPH not defined\n");
#endif

   return 0;
}

Result


Related Tutorials