From owner-freebsd-hackers Sun Jan 31 02:56:44 1999 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id CAA09742 for freebsd-hackers-outgoing; Sun, 31 Jan 1999 02:56:44 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from zeus.theinternet.com.au (zeus.theinternet.com.au [203.34.176.2]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id CAA09736 for ; Sun, 31 Jan 1999 02:56:41 -0800 (PST) (envelope-from akm@zeus.theinternet.com.au) Received: (from akm@localhost) by zeus.theinternet.com.au (8.8.7/8.8.7) id UAA28754; Sun, 31 Jan 1999 20:35:55 +1000 (EST) (envelope-from akm) From: Andrew Kenneth Milton Message-Id: <199901311035.UAA28754@zeus.theinternet.com.au> Subject: Re: some weird C In-Reply-To: <36B41674.2E66D8EC@newsguy.com> from "Daniel C. Sobral" at "Jan 31, 99 05:38:12 pm" To: dcs@newsguy.com (Daniel C. Sobral) Date: Sun, 31 Jan 1999 20:35:55 +1000 (EST) Cc: hackers@FreeBSD.ORG X-Mailer: ELM [version 2.4ME+ PL32 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG +----[ Daniel C. Sobral ]--------------------------------------------- | Andrew Kenneth Milton wrote: | > | > +----[ Malartre ]--------------------------------------------- | > | | > | I was expecting 9, not 10. | > | since 4+5=9? | > | > x is pre-incremented, making it 5 *before* the += takes effect. | > | > This is correct behaviour. | | Explain the 8 then... if x++ takes effect *after* +=, it should have | been 9, right? No. the time at which a post increment operation takes place is undefined, but, before the next *expression* -- Totally Holistic Enterprises Internet| P:+61 7 3870 0066 | Andrew The Internet (Aust) Pty Ltd | F:+61 7 3870 4477 | Milton ACN: 082 081 472 | M:+61 416 022 411 |72 Col .Sig PO Box 837 Indooroopilly QLD 4068 |akm@theinternet.com.au|Specialist To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message