C programming style

Duncan R. Gibson drg at rlvd.UUCP
Thu Jul 18 19:50:22 AEST 1985


Re: i++ and i = i + 1

As an aside, I remember being taught AlgolW as a student, where i := i + 1
and i := 1 + i were equvalent statements, and incremented i. I then moved to
PL360 (yuk!) for a while where i := i + 1 inrements i, and i := 1 + i sets i
to 2.

This caught a lot of students out, especially as the two languages can be
made to look similar. At least i++ and ++i are *obvious* if you  have read
*any* introductory text to C.



More information about the Comp.lang.c mailing list