I got a silly question:
Is this statement basically a do while/while(true) infinite loop?
for (;;) {
...
}Is this statement basically a do while/while(true) infinite loop?
for (;;) {
...
}Lots of people do it because stupid C compilers produce better code for `for(;;)` than they do for `while(1)` and stupid C compilers used to be very common.
It's also one less character spent: A rare win/win.
I am really interested in learning some C however, especially after this post hit front page a few days ago:
for (;;) { ... }
is a valid JavaScript and PHP syntax too. And used also as the first few chars of a JSON stream to prevent other sites consuming your internal API (e.g. Facebook uses it, Google+ uses while(1) { ... } which is longer).