Procecessor Directive : #undef

The #undef preprocessor directive is used to undefine the constant or macro defined by #define. Also note that #undef can undefine only "user defined" directives. It is used in the situation where we need to redefine the constant directive. The syntax of #undef is :
 #undef macro_identifier
Example :
#include <stdio.h>

#define NUM 100

#undef NUM 
   
#define NUM 200

int main() {
  printf("%d\n", NUM);
  return 0;
}
Output :

200


Next : C Language Tutorials List