Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!think!harvard!seismo!rlgvax!hadron!jsdy From: jsdy@hadron.UUCP (Joseph S. D. Yao) Newsgroups: net.lang.c Subject: Re: *p++ = *p results? Message-ID: <338@hadron.UUCP> Date: Thu, 27-Mar-86 00:40:31 EST Article-I.D.: hadron.338 Posted: Thu Mar 27 00:40:31 1986 Date-Received: Sat, 29-Mar-86 05:57:14 EST References: <312@imagen.UUCP> Reply-To: jsdy@hadron.UUCP (Joseph S. D. Yao) Distribution: net Organization: Hadron, Inc., Fairfax, VA Lines: 13 Summary: Only your compiler knows for sure. In article <312@imagen.UUCP> kevin@imagen.UUCP (Kevin L. Malloy) writes: >In the statement *p++ = *p; what will be the result? This kind of thing is specifically defined to be undefined. Whenever you have an incremented or decremented variable used elsewhere in the same expression, the code may be interpreted either way. If the same variable is incremented (or decremented) more than once, the code may be interpreted in any consistent way. i = 0; printf("%d %d %d %d %d %d\n", i++, i--, i++, i--, i++, i--); -- Joe Yao hadron!jsdy@seismo.{CSS.GOV,ARPA,UUCP}