In article <AANLkTikb6zODLg856Pt7n7s7zbjv3m=rftz9FUPkaOGS at mail.gmail.com>,
Ethan Dicks <ethan.dicks at gmail.com> writes:
I think you are imagining it backwards. A for loop
continues *until*
the condition is true.
Huh? A for loop is just a while loop with an initialization chunk and
a per-loop chunk at the end of the while block. What's weird is that
for allows the condition to be omitted and have an implied "true" put
in its place, but while doesn't allow the condition to be omitted.
for (start; condition; incr)
block;
is equivalent to
start;
while (condition)
{
block;
incr;
}
...but you knew that. Just that what you're saying above makes it
sound like a do...while loop, because of your use of the word "until",
but its not a do while, its a while. The loop block is not executed
at all if the condition is false, unlike a do/while loop which always
executes the block once. But I'm sure you knew that, too.
--
"The Direct3D Graphics Pipeline" -- DirectX 9 draft available for download
<http://legalizeadulthood.wordpress.com/the-direct3d-graphics-pipeline/>
Legalize Adulthood! <http://legalizeadulthood.wordpress.com>