In article <47***************@news.sbtc.net>,
cr*@tiac.net (Richard Harter) wrote:
>On Wed, 27 Feb 2008 15:25:06 GMT, sp******@milmac.com (Doug
Miller) wrote:
>>In article <fq**********@registered.motzarella.org>, Richard <de***@gmail.com>
wrote:
>>
>>>For starters theres the
"is it sizeof(x)+y" or "sizeof(x+y)" double take.
Don't be ridiculous; the meaning is just as obvious as in
x = y * a + b;
Or do you look at that statement and have trouble deciphering whether the
right side means ((y * a) + b) or (y * (a + b)) ?
I dunno, I would expect that for most people it is not "just as
obvious". That * binds more closely than + is customary usage in
basic algebra. C (and most other computer languages) uses the
same precedence rules as ordinary usage. "sizeof" is an operator
peculiar to C; its precedence is necessarily idiosyncratic.
I disagree with respect to the degree of "obviousness" -- even if sizeof and +
were at the *same* level of precedence, left-to-right evaluation would still
guarantee that "sizeof x + y" would mean "(sizeof x) + y". It takes (IMHO) a
deliberately obtuse interpretation to suppose that it could mean "sizeof (x +
y)" instead.
--
Regards,
Doug Miller (alphageek at milmac dot com)
It's time to throw all their damned tea in the harbor again.