While this is written in K & R "The scope of a name defined with #define is from its point of definition to the end of the source file being compiled."
Why this piece of code is working fine ?
and why this code is showing error ?Code:#include <stdio.h> #define MAX MAXX #define MAXX 10 int main() { printf("%d", fun()); return 0; } int fun() { return MAX; }
Code:#include <stdio.h> #define MAXX 10 #define MAX MAXX #undef MAXX int main() { printf("%d", fun()); return 0; } int fun() { return MAX; }



LinkBack URL
About LinkBacks



