+ 2

What is the difference between i+1 And i++

22nd May 2018, 4:34 AM
Vikram Singh Rawat
Vikram Singh Rawat - avatar
6 Respuestas
+ 4
i++: Return i and increment i after this expression. i + 1: Return i + 1 without changing i.
22nd May 2018, 2:40 PM
Timon Paßlick
+ 3
"i + 1" doesn't change the value of i and returns the calculated value. The another changes and returns.
22nd May 2018, 4:39 AM
Disvolviĝo;
Disvolviĝo; - avatar
+ 2
i=i+1 is same as i++
22nd May 2018, 4:38 AM
Sachin Artani
Sachin Artani - avatar
+ 2
Immortal🌼 Oh I see, it's similar to pre increment.
22nd May 2018, 5:31 AM
Sachin Artani
Sachin Artani - avatar
0
++i is in general not the same as i = i + 1; as the first is an expression with value i+1 and the later is an statement. But ++i; and i=i+1; are the same
22nd May 2018, 8:05 AM
Max
Max - avatar