+ 1
Whats the difference between ++i and i++?
3 Antworten
+ 1
++i means first increment by one then assign the value & i++ means first assign the value then increment by one.
+ 1
++i means pre-increment and
i++ means post-increment
0
1) Prefix form
y = ++x is equivalent to
x = x + 1
y =x
2) Postfix form
y = x++ is equivalent to
y = x
x = x + 1