difference between c++; and ++c;

Doug Gwyn gwyn at smoke.brl.mil
Tue Apr 9 07:29:15 AEST 1991


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

Some of us find it clearer to treat ++ and -- unary operators the same
way as other unary operators, namely apply them from the left:
	!x	not	x!
	++x	not	x++
This is a matter of style, but that does not mean that it is arbitrary.
(Although in this case I would say that it doesn't matter a whole lot.)



More information about the Comp.lang.c mailing list