How to check whether a Macro is defined or not in C?
To check whether a Macro is defined or not in C language – we use #ifdef preprocessor directive, it is used to check Macros only.
Syntax:
#ifdef MACRO_NAME
//body
#endif
If MACRO_NAME is defined, then the compiler will compile //body (a set of statements written within the #ifdef ... #endif block).
Example:
Output
need an explanation for this answer? contact us directly to get an explanation for this answer