Pelles C forum
C language => Expert questions => Topic started by: andi.martin on December 17, 2008, 07:26:36 PM
-
Hi,
AFAIK the sizeof operator returns a constant expression (integer type).
So why
#if sizeof(char)==1
emits a compiler error..?
Regards,
Andreas Martin
-
Hi,
AFAIK the sizeof operator returns a constant expression (integer type).
So why
#if sizeof(char)==1
emits a compiler error..?
Regards,
Andreas Martin
I would imagine that using it in a pre-processing context is disallowed.
John
-
John is correct. sizeof is evaluated at compile time, while the preprocessor is evaluated before compilation.