Possible Duplicate:
Is “for(;;)” faster than “while (TRUE)”? If not, why do people use it?
I was wondering what is the difference between for(;;)
and while(1)
when both perform same function? Will there be any difference of speed of compilation
The difference with these is that many compilers will warn about while(true)
("constant expression used as loop expression"), while none I know of warn about for(;;)
.
They should generate the same code, though.
no functional difference at all, just a matter of taste.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With