mercredi 6 avril 2016

In C++, is there to return out of a nested function that will end the parent function?

I want something like this to happen:

void a(){
    b()
    // if condition met in b(), exit out of this function also
}
void b(){
    if(condition){
        super return
        // also returns out of function a
    }
}

I can't seem to think of a way to do this. Any help would be appreciated. Thanks!

Aucun commentaire:

Enregistrer un commentaire