Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!chaph.usc.edu!alcor.usc.edu!jeenglis From: jeenglis@alcor.usc.edu (Joe English) Newsgroups: comp.lang.c Subject: Re: difference between c++; and ++c; Keywords: pre post increment decrement grammar style Message-ID: <16748@chaph.usc.edu> Date: 21 Apr 91 16:59:10 GMT References: <389@civet.ukc.ac.uk> <3730@inews.intel.com> <1991Apr18.230559.28858@arcturus.uucp> Sender: news@chaph.usc.edu Organization: A child, an elderly man, a Cuban Lines: 28 Nntp-Posting-Host: alcor.usc.edu berry@arcturus.uucp (Berry;Craig D.) writes: >bhoughto@nevin.intel.com (Blair P. Houghton) writes: >> i += 1; "Increment i." >No, "Increment i then discard the resulting value." Could it be that you >have forgotten that += is an operator, returning the new lhs rvalue? "Discard the resulting value" is a no-op. It's equivalent to "fail to use the resulting value in any subsequent calculations", which is implicitly stated in that the value isn't used again. I might read (void)(i += 1); as "add one to i, then discard the resulting value" but in i += 1; there's no explicit "discard", and talking about the implicit one doesn't really help to illustrate the semantics. This is getting silly... --Joe English jeenglis@alcor.usc.edu