Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

idioot111

Strange for-loop

This topic is 5245 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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?

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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


Share this post


Link to post
Share on other sites
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 --

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!