In C++ you are allowed to have an empty condition inside the for-loop, for example as in for (;;)
or for (int x = 0;; ++x)
. But you can\'t do
The difference between logical statements used in while() and for(;;) loops is that:
in case of for the statement defines condition of exiting the loop
in case of while() the statement defines condition of executing the loop
Assuming that, you see that to enter a loop, you need at least a condition of executing, not a condition of exiting.