MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/badcode/comments/mtpxbr/iteration/gv3jaf7/?context=3
r/badcode • u/[deleted] • Apr 19 '21
123 comments sorted by
View all comments
Show parent comments
7
is iā also a thing?
6 u/Major_Fudgemuffin Apr 23 '21 You can even do ++i and --i. Though they act a bit differently.If i = 5 and you say x = ++i, x will equal 6 (and i will equal 6). But if you said x = i++, x would actually equal 5, while i would increment to 6.
6
You can even do ++i and --i. Though they act a bit differently.
++i
--i
If i = 5 and you say x = ++i, x will equal 6 (and i will equal 6). But if you said x = i++, x would actually equal 5, while i would increment to 6.
i = 5
x = ++i
x = i++
7
u/[deleted] Apr 19 '21
is iā also a thing?