difference between c++; and ++c;

Christopher R Volpe volpe at camelback.crd.ge.com
Wed Apr 10 22:01:02 AEST 1991


In article <2880223615 at ARTEMIS.cam.nist.gov>, miller at GEM.cam.nist.gov
(Bruce R. Miller) writes:
|>
|>In article <1991Apr08.161444.10025 at cs.ruu.nl>, Ernst de Ridder writes: 
|>> 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
|>			    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|>If the side-effect doesn't matter, I prefer to use this:
|>
|>(ie. whitespace).  Most compilers do a good job of optimizing it.  :>>  

If the side effect doesn't matter and the value *does* matter, you're
better off using "c + 1". Granted, it doesn't optimize into nothing quite
as easily, but it does produce more accurate results. :-) :-)
               
==================
Chris Volpe
G.E. Corporate R&D
volpecr at crd.ge.com



More information about the Comp.lang.c mailing list