god this extremely blows because it makes you stop and think about the boundary condition because of pre/post-increment when they could have just written it
-
-
-
My brain parsed it as “for (i = 2; i >= 0; i--)” at first and I was trying to figure out why there were out of bounds array accesses until I realized
- 5 more replies
New conversation -
-
-
Obviously should be (i=2; i —> 0;) much clearer.
-
What always gets me is when someone uses i >= 0 as the condition, except i is a type like "char" that may or may not be signed depending on compiler
End of conversation
New conversation -
-
-
Firing offence code.
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
But when I is 0, the condition check goes false right?
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
C-style loops are bad*
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
I guess we can agree to disagree on that one
-
This one is very wrong though...
- 5 more replies
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.