difference between c++; and ++c;

Norman Diamond diamond at jit345.swstokyo.dec.com
Wed Apr 10 19:44:02 AEST 1991


In article <3730 at inews.intel.com> bhoughto at nevin.intel.com (Blair P. Houghton) writes:
>In article <389 at civet.ukc.ac.uk> mtr at ukc.ac.uk (M.T.Russell) 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."
Nope; it's
     i += 1;    "Increment i then discard the resulting value"

(as opposed to  j = (i += 1);  "Increment i then use the resulting value")

Follow-ups to comp.lang.c.
--
Norman Diamond       diamond at tkov50.enet.dec.com
If this were the company's opinion, I wouldn't be allowed to post it.



More information about the Comp.lang.c mailing list