Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!swrinde!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 Subject: Re: difference between c++; and ++c; Keywords: pre post increment decrement grammar style Message-ID: <3634@texsun.Central.Sun.COM> Date: 11 Apr 91 09:10:54 GMT References: <1991Apr08.161444.10025@cs.ruu.nl> <389@civet.ukc.ac.uk> <3730@inews.intel.com> <3614@texsun.Central.Sun.COM> <1991Apr11.011347.5136@tkou02.enet.dec.com> Sender: news@texsun.Central.Sun.COM Reply-To: terryh@ukcsd.uk.sun.com (Terry Heatlie - Sun UK - Tech Support ) Lines: 28 In article <1991Apr11.011347.5136@tkou02.enet.dec.com>, diamond@jit345.swstokyo.dec.com (Norman Diamond) writes: |> In article <3614@texsun.Central.Sun.COM> terryh@ukcsd.uk.sun.com (Terry Heatlie - Sun UK - Tech Support ) writes: |> >|> > i++; "Save the current value of i, increment i then discard |> >|> > the value just saved" |> >|> > ++i; "Increment i then discard the resulting value" |> >|> i += 1; "Increment i." |> > |> >Of course the value of i+=1 is 1, |> |> W W RRRR OOOO N N GGGGG |> W W W R R O O NN N G G |> W W W W RRRR O O N NN G G |> W W R R OOOO N N GGGG |> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Guilty. Try "1 more than i was to start with" |> >so this is really "increment i and discard the resulting value" |> (Yes, but.) |> -- |> Norman Diamond diamond@tkov50.enet.dec.com |> If this were the company's opinion, I wouldn't be allowed to post it. Regards, Terry Heatlie. Disclaimer: all my own work (except this disclaimer, which I nicked).