difference between c++; and ++c;

Ernst de Ridder hnridder at cs.ruu.nl
Tue Apr 9 02:14:44 AEST 1991


I once read (I'm not sure where, but I believe it was in the C++
programming language) that some C-programmers argue that ++c is neater
than c++.  (In situations where the side-effect doesn't matter).  So
they write (just as an illustration)
	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?

Ernst de Ridder

-- 
	Qualitas qualitatem inducit. Semper ego qualitatem.

popa
iret



More information about the Comp.lang.c mailing list