c++csyntaxfor-loop

What does "for (;;)" (for keyword followed by a pair of semicolons in parentheses) 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 true.