September 1998
Intermediate to advanced
848 pages
20h 13m
English
The #undef directive cancels an earlier #define definition. The #if, #ifdef, #ifndef, #else, #elif, and #endif directives are typically used to produce files that can be compiled in more than one way.
The #undef directive undefines a given #define. That is, suppose you have this definition:
#define LIMIT 400
Then the directive
#undef LIMIT
removes that definition. Now, if you like, you can redefine LIMIT so that it has a new value. Even if LIMIT is not defined in the first place, it is still valid to undefine it. If you want to use a particular name and you are unsure whether it has been used previously, you can undefine it to be on the safe side.
With some compilers, you can redefine a defined name ...
Read now
Unlock full access