c++csyntaxfor-loop

What does "for(;;)" mean?


In C/C++, what does the following mean?

for(;;){
    ...
}

Solution

  • It's an infinite loop, equivalent to while(true). When no termination condition is provided, the condition defaults to false (i.e., the loop will not terminate).