Because sizeof
is evaluated at compilation time while directives are evaluated before compilation, and the part that does that is not the compiler, so it won’t understand what sizeof
means.
More Related Contents:
- Why isn’t the size of an array parameter the same as within main?
- C sizeof a passed array [duplicate]
- Overloading Macro on Number of Arguments
- C macros and use of arguments in parentheses
- Should I use #include in headers?
- Are there any platforms where pointers to different types have different sizes?
- Why does sizeof(x++) not increment x?
- How to make a variadic macro (variable number of arguments)
- Is it possible to iterate over arguments in variadic macros?
- “#include” a text file in a C program as a char[]
- How to write a while loop with the C preprocessor?
- Including one C source file in another?
- How, exactly, does the double-stringize trick work?
- What exactly do C include guards do?
- Array-size macro that rejects pointers
- Can gcc output C code after preprocessing?
- Why does the C preprocessor interpret the word “linux” as the constant “1”?
- Shall I prefer constants over defines?
- Macro returning the number of arguments it is given in C? [duplicate]
- Is dereferencing null pointer valid in sizeof operation [duplicate]
- Seeing expanded C macros
- What are C macros useful for?
- How to get the string size in bytes?
- Opposite of C preprocessor “stringification”
- C – SizeOf Pointers
- Sizeof vs Strlen
- Pseudo-generics in C
- What is the possible use for “#define for if (false) {} else for”?
- Is there any reason not to use fixed width integer types (e.g. uint8_t)?
- why sizeof(‘a’) is 4 in C? [duplicate]