Strange for-loop

Started by
2 comments, last by idioot111 20 years ago
I noticed this code while making BB collision detection (Bounding box) collision detection. directly from 3DDisplayObject.cpp from (SDK root)\samples\c++\demos\donuts4\

for(;;)
as far as i have been able to decipher it is it like this

for(/*nothing*/ ; /*nothing*/ ; /*nothing*/ )
Does this mean it is a infinty loop? and why don''t we use it while or do for that?
----------------------Wow! I'm good! No wait, I'm better than good! I'm Perfect...Nah, just good! Otherwise I wouldn't have to improve-- Wouter Lindenhof --
Advertisement
the for(; loop is also equivalent to this: while(1)

its a never ending loop!! YAAAY!

as far as why to use it instead of a while, I do not know. But its equally as fun!

..except when u get stuck in one

~Guyaton
~guyaton
quote:Original post by guyaton
as far as why to use it instead of a while, I do not know. But its equally as fun!
..except when u get stuck in one
~Guyaton


Thanks Guyaton, what a quick replay (less than a minute ).
And who wouldn''t hate doing the same thing over and over again.

but thanks anyway


----------------------Wow! I'm good! No wait, I'm better than good! I'm Perfect...Nah, just good! Otherwise I wouldn't have to improve-- Wouter Lindenhof --
I have closed the tread becuase my answer was answered

Wow! I''m good! No wait, I''m better than good! I''m Perfect...
Nah, just good! Otherwise I wouldn''t have to improve
-- Wouter Lindenhof --
----------------------Wow! I'm good! No wait, I'm better than good! I'm Perfect...Nah, just good! Otherwise I wouldn't have to improve-- Wouter Lindenhof --

This topic is closed to new replies.

Advertisement