continue in for loop

Posted By: sheefo

continue in for loop - 08/05/07 18:36

Shouldn't using 'continue' in a for loop terminate the current iteration and jump to it's increment expression? In LiteC it only terminates without incrementing.
Anyone know anything about this? Am I right or wrong?
Posted By: sheefo

Re: continue in for loop - 08/07/07 13:22

Does anyone give a crap about for loops? There are useful but not properly implemented in LiteC. They should be able to define variables, like..
Code:

for(int i = 0; i < n; i++)


... but they can't. Also, the continue statement does not increment 'i', it just re-does the current loop.

WHY IS THIS HAPPENING!?
Posted By: Excessus

Re: continue in for loop - 08/07/07 14:03

Defining a variable inside a for loop is a C++ only feature (not C), but it would be a nice addition to Lite-C.

A continue inside a for loop should indeed jump to the test and perform the iteration, so that might be a bug.
Posted By: sheefo

Re: continue in for loop - 08/07/07 14:39

Thank you soo much Exessus!

I can live without defining variables in the for loop and I hope this 'continue' bug is fixed in the next version... I'll mention it in the public beta test topic.
© 2023 lite-C Forums