Not logged in
Log in now
Create an account
Subscribe to LWN
Recent Features
LWN.net Weekly Edition for May 23, 2013
An "enum" for Python 3
An unexpected perf feature
LWN.net Weekly Edition for May 16, 2013
A look at the PyPy 2.0 release
Btrfs aims for the mainline
Posted Jan 7, 2009 23:28 UTC (Wed) by tialaramex (subscriber, #21167) [Link]
for (int k = 0; k < N; ++k) { /* do something */ }
It won't do them N+1 times because after the Nth iteration k is N and will fail the condition (k < N)
(Actually mine is a slightly more modern idiom, requiring C9X semantics, and it has the K&R increment style, but it amounts to the same thing)
Copyright © 2013, Eklektix, Inc. Comments and public postings are copyrighted by their creators. Linux is a registered trademark of Linus Torvalds