& operator

chris at umcp-cs.UUCP chris at umcp-cs.UUCP
Tue Dec 6 22:37:49 AEST 1983


Regarding "char *in, *out; ... out = &*in++;":

"&" has meaning only when used before an expression which is an
lvalue.  In this case the expression *is* an lvalue (the character
that "in" used to point to before the increment), so the correct
behaviour would be to assign the old value of "in" to "out".

I would say that unless you feel like proving that the implementation
is (or is not) correct, you should avoid such constructs.
-- 
In-Real-Life: Chris Torek, Univ of MD Comp Sci
UUCP:	{seismo,allegra,brl-bmd}!umcp-cs!chris
CSNet:	chris at umcp-cs		ARPA:	chris.umcp-cs at CSNet-Relay



More information about the Comp.lang.c mailing list