Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!linus!philabs!seismo!harpo!floyd!clyde!ihnp4!inuxc!pur-ee!uiucdcs!parsec!ctvax!uokvax!andree From: andree@uokvax.UUCP Newsgroups: net.lang.c Subject: Re: & operator - (nf) Message-ID: <4604@uiucdcs.UUCP> Date: Sun, 18-Dec-83 22:49:49 EST Article-I.D.: uiucdcs.4604 Posted: Sun Dec 18 22:49:49 1983 Date-Received: Wed, 21-Dec-83 01:24:48 EST Lines: 25 #R:iwu1a:-16200:uokvax:3000012:000:840 uokvax!andree Dec 16 09:38:00 1983 /***** uokvax:net.lang.c / fortune!olson / 9:57 pm Dec 14, 1983 */ 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. (The original article did not include the second line of my example, and asked whether out should be set to 'in', or 'in+1'. The answer is of course 'in'. The question is not meaningful as stated. The question should be: does it point to the ORIGINAL value of 'in', or the incremented value of 'in'.) Dave Olson /* ---------- */ Yes, but the & operator is not being applied to `in', but to `*in', with the increment happening AFTER the dereference. Therefore, you should get buf, not buf+1.