User Tools

Site Tools


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

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

c:preprocessor:undef [2013/01/22 13:36]
Daniel Gohlke created
c:preprocessor:undef [2013/01/22 22:02] (current)
Line 1: Line 1:
 +====== #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\\
 +<code c>
 +#undef macro_name
 +</code>
 +
 +===== c undef example =====
 +<code c>
 +  #include <stdio.h>
 +
 +  int main(void)
 +  {
 +    #define TESTDEFINE 1
 +      printf("%d\n", TESTDEFINE);
 +
 +    #undef TESTDEFINE
 +
 +    #define TESTDEFINE 42
 +      printf("%d\n", TESTDEFINE);
 +
 +    return 0;
 +  }
 +</code>
 +
 +=== output ===
 +     1
 +     42
  
advertising

Impressum