I'd like to use continue
statement (parametrized) n times:
int n = 7;
while(running()) {
commandA;
if(something) continue; // <- not once, but n times
commandB;
...
}
I'd like to use something like for(int i=0; i<n; ++i) continue;
but the continue should be applied to the outer (while) loop. I'd like to skip n passes of the while loop.
The purpose is to always execute commandA
, but skip n times commandB
if running()
condition is satisfied.
Is it possible to code that in C?