Click to See Complete Forum and Search --> : Strange loops
Wynd
Jun 13th, 2001, 04:33 PM
for ( ; ; )
{
//code here
}
What does it do? Is it an infinite loop or something?
parksie
Jun 13th, 2001, 05:22 PM
Yes. It keeps going until you use break; :)
Megatron
Jun 13th, 2001, 05:44 PM
It is however, more proper to use a While loop for that purpose.
parksie
Jun 13th, 2001, 05:47 PM
Not so sure, I think you can use both, since I've seen lots of usages of bothwhile(1) { }andfor(;;) { }
kedaman
Jun 13th, 2001, 05:49 PM
i'd use for(;;){} , looks better ;) i guess it's a qwestion of taste, anything for can do, can be done with while and vice versa
Megatron
Jun 13th, 2001, 06:04 PM
Notice the smilies that come up when you type for(;;)
kedaman
Jun 14th, 2001, 06:58 AM
yeah ;) i didn't bother turn off the smilies or put in a space, it looks funny :p
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.