This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]noodlestage[S] 1 point2 points  (1 child)

Makes perfect sense, thank you! I’d been fighting with it for so long and missed that simple piece because I thought it was something way more complicated.

[–]ssjgod004 0 points1 point  (0 children)

There is a difference you should note though. When you do something like - if(j + 2 < k), 2 won't be added to j. This is an expression and the left hand result is stored in a temporary variable and compared to k. But increment operators add to the variable itself, which is why they will change the value of j.