Xref: utzoo comp.lang.c:38118 comp.std.c:4654 Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!newstop!texsun!ukcsd.uk.sun.com!terryh From: terryh@ukcsd.uk.sun.com (Terry Heatlie - Sun UK - Tech Support ) Newsgroups: comp.lang.c,comp.std.c Subject: Re: difference between c++; and ++c; Keywords: pre post increment decrement grammar style Message-ID: <3614@texsun.Central.Sun.COM> Date: 10 Apr 91 11:20:06 GMT References: <1991Apr08.161444.10025@cs.ruu.nl> <389@civet.ukc.ac.uk> <3730@inews.intel.com> Sender: news@texsun.Central.Sun.COM Reply-To: terryh@ukcsd.uk.sun.com (Terry Heatlie - Sun UK - Tech Support ) Followup-To: comp.lang.c Lines: 25 In article <3730@inews.intel.com>, bhoughto@nevin.intel.com (Blair P. Houghton) writes: |> In article <389@civet.ukc.ac.uk> mtr@ukc.ac.uk (M.T.Russell) writes: |> >Notionally we have: |> [...I have no joke here, I just like the proper use of the word "notionally..."] |> [ :-) and I need a little inews-inclusion-meter fodder :-( ] |> > i++; "Save the current value of i, increment i then discard |> > the value just saved" |> > ++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. |> |> i += 1; "Increment i." Of course the value of i+=1 is 1, so this is really "increment i and discard the resulting value" |> |> --Blair |> "Notionally, 'mu.'" Regards, Terry Heatlie. Disclaimer: all my own work (except this disclaimer, which I nicked).