#ifndef asks whether the following identifier is not defined; - C Preprocessor

C examples for Preprocessor:Preprocessor Operators

Introduction

#ifndef is the negative of #ifdef.

This directive is often used to define a constant if it is not already defined.

#ifndef SIZE 
  #define SIZE 100 
#endif    
#ifndef NAMES_H_ 
  #define NAMES_H_ 
  // constants 
  #define SLEN 32 
   
     char first[SLEN]; 
     char last[SLEN]; 
#endif

Related Tutorials