+ 1
increment a loop
why is that when you use x++ in the for-loop during incrementing gives a different result unlike using x+1.
3 Answers
+ 1
x+1 doesn't increase the value of the variable x. ++x does.
So when your loop depends on x increasing, the first method wouldn't give you what you want.
0
Can you post an example?
0
x+=1 increments the loop