+ 4
What is the difference between i++ and ++i
please answer, i'm having test tomorrow
6 Respuestas
+ 9
In the beginning.beginner will think like what @Ryan Ward said
but the truth is
++i will do increment first then return the i
i++ will make copy form of i then do increment after there return that copy form
which mean that ++i is faster than i++
+ 14
@francis
that tick is for best (which helped you the best) answer. not so you can tick your own answer.
https://www.sololearn.com/discuss/286200/?ref=app
https://www.sololearn.com/discuss/345567/?ref=app
+ 11
https://www.sololearn.com/discuss/489143/?ref=app
+ 6
one increments before using the value and the other increments after using the variable. Google prefix and postfix if you need more info.
+ 6
i++ : "i" value is read by the compiler and increments the value by 1, like i=I+1.
++i : first it increments the value by 1 and uses the "i" value, like 1+i= i.
+ 4
thnx for help