+ 2
So... X++ increase the value, and ++X decrease the value ?
Help me to understand, when can ai used ++X
2 odpowiedzi
+ 6
X++ and ++X increase while x-- and --x decrease.
they are the same when they are alone, but when in comparative statements or in assigning, things change. y = X++ here y would have the old value of x, then the value of x goes up. with y = ++x, the value of x goes up and its new value is assigned to y
EDIT:
The same goes for comparing.
0
(x++ & ++x increase) (--x & x-- decreases )