4 ms·
> because I struggle to remember which position the comparison vs. increment goes Tip: they're in the same order they're used: comparison is always run at the
by DiThi 9y ago
> because I struggle to remember which position the comparison vs. increment goes
Tip: they're in the same order they're used: comparison is always run at the beginning of each iteration, and increment is always done at the end.
for(init; cond; last) ...
init; while(cond) { ... ; last;}
But I also dislike it and love "for ... in" constructs.
- vidarh 9y agoTried many ways of remembering it, gave up and decided a more reliable workaround. I don't know why I find it so hard to remember. Then again I've found an even more reliably workaround by not writing much C these days.