Xref: utzoo comp.lang.c:38062 comp.std.c:4638 Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!think.com!snorkelwacker.mit.edu!bloom-beacon!eru!hagbard!sunic!mcsun!ukc!harrier.ukc.ac.uk!civet.ukc.ac.uk!mtr From: mtr@ukc.ac.uk (M.T.Russell) Newsgroups: comp.lang.c,comp.std.c Subject: Re: difference between c++; and ++c; Keywords: pre post increment decrement grammar style Message-ID: <389@civet.ukc.ac.uk> Date: 8 Apr 91 20:46:43 GMT References: <1991Apr08.161444.10025@cs.ruu.nl> Reply-To: mtr@ukc.ac.uk (M.T.Russell) Organization: Computing Lab, University of Kent at Canterbury, UK. Lines: 18 In article <1991Apr08.161444.10025@cs.ruu.nl> hnridder@cs.ruu.nl (Ernst de Ridder) writes: >[Why is ++i better than i++ when the value is unused] Because it is a more direct expression of the desired operation. Notionally we have: i++; "Save the current value of i, increment i then discard the value just saved" versus: ++i; "Increment i then discard the resulting value" Obviously most compilers will generate exactly the same code for either case, but it is nice to express what you mean as directly as possible. Mark