The #undef directive removes a previously defined definition of the macro name that follows it. That is, it "undefines" a macro. The general form for #undef is
#define LEN 100
#define WIDTH 100
/* at this point both LEN and WIDTH are undefined */
Both LEN and WIDTH are defined until the #undef statements are encountered. #undef is used principally to allow macro names to be localized to only those sections of code that need them.
Post a Comment