Re: Compile Error C1017 With sizeof()
- From: "Alexander J. Oss" <alex@xxxxxxxxxxx>
- Date: Wed, 10 May 2006 01:51:40 -0400
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)?
.
- Follow-Ups:
- Re: Compile Error C1017 With sizeof()
- From: Alexander Grigoriev
- Re: Compile Error C1017 With sizeof()
- From: Igor Tandetnik
- Re: Compile Error C1017 With sizeof()
- From: Alex Blekhman
- Re: Compile Error C1017 With sizeof()
- From: Ulrich Eckhardt
- Re: Compile Error C1017 With sizeof()
- References:
- Compile Error C1017 With sizeof()
- From: Alexander J. Oss
- Re: Compile Error C1017 With sizeof()
- From: Doug Harrison [MVP]
- Compile Error C1017 With sizeof()
- Prev by Date: Re: Stop Giving Me All Those Errors!
- Next by Date: Re: Changing Service Logon
- Previous by thread: Re: Compile Error C1017 With sizeof()
- Next by thread: Re: Compile Error C1017 With sizeof()
- Index(es):