|
| |||||||||||||||||||||||||||||||||||
| ahsan125 (1) | |
|
i am confused about the for loop when it is written as for(;;) can anybody tell me what does it mean thanks in advance | |
|
|
|
| Faldrax (324) | |||||
This is a loop which will run for ever, and is typically used where the code inside the loop include a brake statement on some specific condition to force exit from the loop. It is the same as
| |||||
|
|
|||||
| xabnu (72) | |
|
Are you familiar with for() loops in general? http://www.cplusplus.com/doc/tutorial/control.html for(;;) would just mean nothing is initialised before looping, no truth is checked, and nothing is 'incremented'. Incremented in quotes, because the language only cares that this is an expression, not what it does. | |
|
Last edited on
|
|