[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tinycc-devel] Strange sizeof construct

From: Mike
Subject: Re: [Tinycc-devel] Strange sizeof construct
Date: Thu, 22 Nov 2007 11:49:00 -0500
User-agent: Thunderbird (Windows/20071031)

Right.  You said "[] can be applied to any pointer."  That sounds right.

What's this a few emails ago with [] being applied to immediate values in C99, like this


Fred Weigel wrote:

sizeof is an operator

arr evaluates to the base of the array. [] is an operator.

since arr is the base of the array, (arr) is the same value (putting
in the parentheses doesn't change a thing). The precedence is identical!

so, if "sizeof arr[0]" works, then "sizeof (arr) [0]" should be identical.
Since [] is higher precedence, "sizeof(arr[0])" is ALSO the same. And,
just for grins, try:


Of course, this is because [] is an operator in C, and not part of a
variable construct. This means that any [] can be applied to any pointer.

Tinycc-devel mailing list

reply via email to

[Prev in Thread] Current Thread [Next in Thread]