+ 5
What is the difference between ++i & i++
4 Answers
+ 7
well let's say
x=i++
it is equal to writing
x=i
i=i+1
if x=++i
it equals to writing
i=i+1
x=i
so if i=5
and x=++i
then x=6 and i=6
and if x=i++
then x=5 and i=6
+ 1
++i before increase , i++ after the increase
0
The precedence
0
Abdulrahman has it correct. The difference between i++ and ++i is when to calculate the addition. Do I run the command before adding one to the log or do I run the command after I add one?



