Confusion in instruction

i am confused about the for loop when it is written as
for(;;)
can anybody tell me what does it mean
thanks in advance
1
2
3
4
for(;;)
{
   //Do Something
}

This is a loop which will run for ever, and is typically used where the code inside the loop include a brake statement on some specific condition to force exit from the loop.
It is the same as
1
2
3
4
while(true)
{
   //do something
}
Are you familiar with for() loops in general?

http://www.cplusplus.com/doc/tutorial/control.html

for(;;) would just mean nothing is initialised before looping, no truth is checked, and nothing is 'incremented'. Incremented in quotes, because the language only cares that this is an expression, not what it does.
Last edited on
Topic archived. No new replies allowed.