(a) because see what Carmack said (b) my canonical example was for (i=0; i < n; ++i) now for (i=n-1; i >= 0; --i) // i must be signed
-
-
That is ALSO a terrible idiom.
-
I don't see why. You can use a loop-scope var for i-1 to avoid writing "i-1" multiple times.
-
Alternatively: for (size_t i=n-1; i!=-1; i--)
-
But your form with a signed i is erroneous; it does the wrong thing if n is large.
End of conversation
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.