Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!batcomputer!caen!zaphod.mps.ohio-state.edu!think.com!compass!worley From: worley@compass.com (Dale Worley) Newsgroups: comp.lang.c Subject: Re: post-decrement quirk? Message-ID: Date: 18 Jun 91 14:03:43 GMT References: <1991Jun17.230838.9628@auto-trol.com> Sender: root@compass.com Distribution: usa Organization: Compass, Inc., Wakefield, MA, U.S.A. Lines: 16 In-reply-to: julbro@auto-trol.com's message of 17 Jun 91 23:08:38 GMT In article <1991Jun17.230838.9628@auto-trol.com> julbro@auto-trol.com (Julie Brown) writes: Can anyone explain to me why the following does not work (at least on the Sun): q = q--; pre-increment works just fine (q = --q;). According to Ansi C, neither of these is valid, because they both modify q twice between two sequence points (during a statement). The fact that the second happens to do what you want it to is luck. BTW, what *is* it that you want to do? "q--" is equivalent to "q = q-1" already, so you don't have to assign the result to q... Dale Worley Compass, Inc. worley@compass.com -- Start the project after the deadline -- the time pressure is less then.