|
-
Jun 13th, 2001, 04:33 PM
#1
Thread Starter
Fanatic Member
Strange loops
Code:
for ( ; ; )
{
//code here
}
What does it do? Is it an infinite loop or something?
Alcohol & calculus don't mix.
Never drink & derive.
-
Jun 13th, 2001, 05:22 PM
#2
Monday Morning Lunatic
Yes. It keeps going until you use break;
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Jun 13th, 2001, 05:44 PM
#3
It is however, more proper to use a While loop for that purpose.
-
Jun 13th, 2001, 05:47 PM
#4
Monday Morning Lunatic
Not so sure, I think you can use both, since I've seen lots of usages of bothand
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Jun 13th, 2001, 05:49 PM
#5
transcendental analytic
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
Last edited by kedaman; Jun 13th, 2001 at 05:52 PM.
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Jun 13th, 2001, 06:04 PM
#6
Notice the smilies that come up when you type for(;;)
-
Jun 14th, 2001, 06:58 AM
#7
transcendental analytic
yeah i didn't bother turn off the smilies or put in a space, it looks funny
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|