#define #undef - .
.
#define M (X) 2 * (X)
(1);
#undef M
(2)
Since these are preprocessor directives before compilation, the preprocessor will simply be replaced after #define M (X) 2 * (X) in this source file.
M (1) s 2 * 1
if the preprocessor finds #undef M, it will no longer be replaced
M (2) with 2 * 2, because M is destroyed when #undef M.
#undef is used if you want to give a different definition for an existing macro
source
share