+ 1
what is the difference between ++x and x++
3 Answers
+ 2
++x sums one and returns x, x++ returns x and THEN sums one
+ 1
++x means x+1=x,, increment is performed first then value is assigned
x++ means x=x+1,, value is assigned first then increment is performed..
+ 1
With objects you have to notice that post increment creates (often) an unnecessary copy of the object. This might affect the performance. Smart compilers however optimize this.