continue statement

1
2
3
4
5
6
7
8
9
10
void func(){
    //do stuf
    continue;
}
int main(){
    for(int i=0;i<10;i++){
        if(i==5)func();
    }
    return 0;
}

Is there any way I could do this?
nope, sorry. You'll need to continue from inside the loop itself, in the Main function. the continue in the func() has no refference.

currently, if that is the extent of the code, the continue is pointless. If however there is more code you're not showing us, after the call to func(), that you want to skip in that case, then
if (i==5)
{
func();
continue;
}
Last edited on
Topic archived. No new replies allowed.