difference between c++; and ++c;

Scott Amspoker scott at bbxsda.UUCP
Tue Apr 9 05:14:02 AEST 1991


In article <1991Apr08.161444.10025 at cs.ruu.nl> hnridder at cs.ruu.nl (Ernst de Ridder) writes:
>	while ( c < 100)
>	   ++c;
>instead of
>	while ( c < 100)
>	   c++;
>
>Why should one of these forms be preferred over the other in such a situation,
>apart from personal preferences?

Apart from personal preference - none.  Some people (like myself) prefer
the first form (++c) because the second form (c++) *implies* preserving
the current value of c prior to incrementing.  Sure, that really doesn't
happen but you know how wierd programmers can be.

-- 
Scott Amspoker                       | Touch the peripheral convex of every
Basis International, Albuquerque, NM | kind, then various kinds of blaming
(505) 345-5232                       | sound can be sent forth.
unmvax.cs.unm.edu!bbx!bbxsda!scott   |    - Instructions for a little box that
                                     |      blurts out obscenities.



More information about the Comp.lang.c mailing list