The #define directive is a preprocessor directive, which means that it is called by the preprocessor before anything is even compiled.
Therefore, if you type:
#define NUMBER 100
And then you enter:
int x = NUMBER;
What your compiler sees is simple:
int x = 100;
Basically, as if you opened your source code in a word processor and found find / replace to replace each occurrence of "NUMBER" with "100". Therefore, your compiler has no idea about the existence of NUMBER . Only the precompiler preprocessor knows what NUMBER means.
So, if you try to take the address NUMBER , the compiler will think that you are trying to take the address of the integer literal constant, which is unacceptable.
source share