Maxim
Fri Nov 05 08:18:17 CST 2004
sizeof() of a constant string includes the trailing zero added by the
compiler. This is a well known C and C++ feature.
--
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
maxim@storagecraft.com
http://www.storagecraft.com
"John Thompson" <johnthompson1@hotmail.com> wrote in message
news:418b8a4e$1@news.xetron.com...
> Hello. This seems odd to me. I have the following:
>
> #define it "\x0\x0\x0\x0\x0\x0\x0\x0"
>
> If I do:
>
> DbgPrint("The size of it = 0x%x\n", sizeof(it));
>
> This prints out:
> The size of it = 0x9
>
> Shouldn't this value be 8?
>
> Thanks,
> John
>
>