(no subject)

Date: 2006-04-11 09:01 am (UTC)
simont: A picture of me in 2016 (Default)
From: [personal profile] simont
Declaration mimics use. "int * x" means that "*x" is an "int", not that "x" is an "int *". If it meant the latter, then "int* x,y" would declare two pointers. It's all in K&R, all in K&R; bless me, what do they teach them at these schools?

I had to double-check that C++ references worked the same way; since Stroustrup believes in the wrong notation for pointers, I had a nasty feeling he might have built the wrong semantics into his bit of the language. But no; "int&x,y" declares y to be an int, not a reference, so regardless of Stroustrup's own silly spacing convention the same rule applies for sane people.

(no subject)

Date: 2006-04-11 09:02 am (UTC)
ext_8103: (Default)
From: [identity profile] ewx.livejournal.com
Absolutely, yes. I've just seen quite a bit of the wrongly-spaced form lately from otherwise-sensible people...

November 2025

S M T W T F S
      1
2345678
91011121314 15
1617 181920 2122
23242526272829
30      

Most Popular Tags

Expand Cut Tags

No cut tags