Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the condition for this "for(;;)" loop? [duplicate]

Can someone explain what is the condition for this for loop?

for(;;) {
 //do sth.
}
like image 899
user3280180 Avatar asked Dec 18 '25 18:12

user3280180


2 Answers

It has no condition. It's an infinite loop.

like image 177
Eran Avatar answered Dec 20 '25 09:12

Eran


If the test condition is empty (and it is here), there is no test and the loop continues indefinitely. It's a short form for an infinite loop.

like image 23
Elliott Frisch Avatar answered Dec 20 '25 09:12

Elliott Frisch



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!