Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site psivax.UUCP Path: utzoo!watmath!clyde!cbosgd!hplabs!sdcrdcf!psivax!friesen From: friesen@psivax.UUCP (Stanley Friesen) Newsgroups: net.lang.c Subject: Re: *p++ = *p results? Message-ID: <1078@psivax.UUCP> Date: Mon, 24-Mar-86 11:22:54 EST Article-I.D.: psivax.1078 Posted: Mon Mar 24 11:22:54 1986 Date-Received: Wed, 26-Mar-86 04:14:47 EST References: <312@imagen.UUCP> Reply-To: friesen@psivax.UUCP (Stanley Friesen) Distribution: net Organization: Pacesetter Systems Inc., Sylmar, CA Lines: 15 In article <312@imagen.UUCP> kevin@imagen.UUCP (Kevin L. Malloy) writes: >In the statement *p++ = *p; what will be the result? Will p be equal >to itself or will p be equal to the next value it is pointing to? >In other words should p be incremented after it is evaluated or should >p be incremented after the assignment operation is finished?-- >--- The answer is - either. They are both "correct" since timing of side-effects like assignment and post-increment is implementation defined i "C". Do not ever write code like this! -- Sarima (Stanley Friesen) UUCP: {ttidca|ihnp4|sdcrdcf|quad1|nrcvax|bellcore|logico}!psivax!friesen ARPA: ttidca!psivax!friesen@rand-unix.arpa