Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!rutgers!mtune!codas!cpsc6a!rtech!wrs!dg From: dg@wrs.UUCP (David Goodenough) Newsgroups: comp.lang.c Subject: Re: Style [++i vs i++] Message-ID: <210@wrs.UUCP> Date: Thu, 2-Jul-87 14:42:25 EDT Article-I.D.: wrs.210 Posted: Thu Jul 2 14:42:25 1987 Date-Received: Sat, 4-Jul-87 13:12:17 EDT References: <17310@amdcad.AMD.COM> <17315@amdcad.AMD.COM> Reply-To: dg@wrs.UUCP (David Goodenough) Organization: Wind River Systems, Emeryville, CA Lines: 29 In article <17315@amdcad.AMD.COM> markg@amdcad.UUCP (Mark Gorlinsky) writes: >In article <17310@amdcad.AMD.COM> tim@amdcad.AMD.COM (Tim Olson) writes: >>Which operator (pre-increment or post-increment) do you use when the side- >>effect is the only desired action and the result is discarded, i.e. >> >> for (i=0; i >Sorry Tim, I have to disagree with you. I hate to see sloppy 'C' code, when it >can be avoided, but this is perfectly fine. The use of the post-increment or >decrement operator to bump a value up|down, when not being passed as an >argument, doesn't generate any side-effects. Both will produce the same code. >-- > Mark Gorlinsky - AMD Processor Products Division/APPS SQA I must agree with Mark - I use (and prefer) i++, and EVEN using Lifeboat's BDS C compiler (for the Intel 8080 (Vintage 1979 Micro) :-)) the code for a i++ on its own is: ld hl,(_i) inc hl ld (_i),hl -- dg@wrs.UUCP - David Goodenough +---+ | +-+-+ +-+-+ | +---+