User Tools

Site Tools


Sidebar

Programming Reference/Librarys

Question & Answer

Q&A is closed







c:preprocessor:undef
click
to support this page (eg 0,42 € or so) Thanks.

Table of Contents

#undef

Description

With the # undef a macro can be overridden.
Status “defined” or “undefined” is an important characteristic of an identifier, regardless of its actual definition.
The # ifdef and # ifndef can be used to check whether an identifier is currently defined or not.

Syntax

#undef macro_name

c undef example

  #include <stdio.h>
 
  int main(void)
  {
    #define TESTDEFINE 1
      printf("%d\n", TESTDEFINE);
 
    #undef TESTDEFINE
 
    #define TESTDEFINE 42
      printf("%d\n", TESTDEFINE);
 
    return 0;
  }

output

   1
   42
advertising
c/preprocessor/undef.txt · Last modified: 2013/01/22 22:02 (external edit)

Impressum