0

I know the meaning of ++i and i++ but does it make any difference when we use them in for loop

if we are using pre increment and post increment does it make any difference in working of a loop. help will be appreciated 😊

20th Mar 2017, 8:24 AM
Serjeel Ranjan
Serjeel Ranjan - avatar
2 odpowiedzi
+ 14
Nope. It runs separate from anything else, so the pre/post difference doesn't show itself. I usually see i++ though.
20th Mar 2017, 8:31 AM
Tamra
Tamra - avatar
+ 1
Pre increment is slightly faster though, because it doesn't need to keep a copy of the previous value.
20th Mar 2017, 10:02 AM
Dennis
Dennis - avatar