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:01 am (UTC)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)