& operator - (nf)

Mike Leibensperger leiby at yeti.UUCP
Fri Dec 16 03:02:44 AEST 1983


Dave Olson says:

	I would have to disagree with chris as to what should be assigned by:
	    char *in, *out, buf[];
	    in = buf;
	    out = &(*in++);
	since he forgot the parentheses.  Given the parentheses, out SHOULD
	be set buf+1; that is, 'in' is incremented BEFORE the & operator is
	applied.

I beg to differ.  In evaluating the subexpression "in++", the value returned
is the original value of "in".  Thus, "out" will get the original value of
"in".

(Now to go try it for real!  Flame first, ask questions later... :-) ).

-- 
Mike Leibensperger,  Massachusetts Computer Corporation
...!{ucbcad,tektronix,harpo,decvax}!masscomp!leiby



More information about the Comp.lang.c mailing list