Small question just to clarify.
In ZX-Spectrum BASIC compiler there is FOR TO STEP NEXT looping, where TO is unconditional:
10 FOR i=1 TO 5 STEP 1
I've tried similar practice in C
for (i=1; i==5; i++);
and the of course loop does not work (== is never true here)... so the question is:
Is in C FOR loop we should always use a CONDITION to stop the loop (I mean CONDITION in parentheses of the FOR statement), like FOR (i=0; i<6; i++);
You could use
But it would be better to use
i = 0 ... i < 5
, in case you alteri
inside of the loop. It also communicates what you are doing better.