#ifdef and #endif in c
Directive #ifdef is very similar to #if except its conditional statement which is identifier instead of a constant expression. Identifier may a macro constant or global identifier. It only checks identifier has been defied or not. It doesn’t care what the value of identifier is. If identifier has been defined then it executes #ifdef body otherwise it executes the body of #else directive.
Note: Global identifiers are predefined macro constats.
#define ABC 25
#define PQR "Exact Help"
int num = 3;
printf("%d",ABC * ABC);
Explanatiopn: Since macro constant ABC has defined so #ifdef condition is true.
printf("First define the __DATE__");
Output: It will print current system date.
Explanation: __DATE__ is global identifier. It has already defined in the header file stdio.h and it keeps the current system date.