Re: Compile Error C1017 With sizeof()



It should, since sizeof isn't part of the preprocessor language. And
you're
right, sizeof(char) is 1 by definition. In C and C++ terms, "char" and
"byte" are synonymous, and they don't necessarily imply 8 bits, though
usually they do.

The preprocessor language includes "constant-expression" (according to
16.1.1 and 16.1.3), and 5.19 is what defines an integral
"constant-expression", and that definition includes sizeof().

....ugh, I just found the following quote at
http://msdn2.microsoft.com/en-us/library/ew2hz0yd.aspx:

The expression cannot use sizeof or a type-cast operator.

Why is this quote present here but not in the C++ standard (that I could
find)?


.