|
|
On Sun, 30 Mar 2008 23:11:55 +0300, Ioannis Vranos wrote:
> Ian Collins wrote:
>> Ioannis Vranos wrote:
>>> Ioannis Vranos wrote:
>>>> I first saw that only sizeof x is valid at the pdf hosted at
>>>> http://cprog.tomsweb.net.
>>>
>>> More specifically the above writes:
>>>
>>> "sizeof Returns size of operand in bytes; two forms:
>>> 1) sizeof(type)
>>> 2) sizeof expression"
>>>
>>>
>> Did you read what Harald said: "(x) is a perfectly valid expression"?
>
> ... right. However sizeofx doesn't compile and if (x) was considered an
> expression it should be sizeof (x), and sizeof(x) shouldn't compile.
sizeofx doesn't compile because there's no sizeof operator. There's a
sizeofx identifier. sizeof(x) does and should compile because sizeof( is
not a valid identifier. This is the same reason why a+++++b is not valid,
but a+++--b is: the first is split into {a}{++}{++}{+}{b}, and the second
is split into {a}{++}{+}{--}{b}.
|
|