Perhaps there is a fancy term for this. Lets say I have this code:
void a(){
b();
}
void b(){
c();
}
void c(){
a();
// do something
if (FLAG_COMPLETE){
return;
}
}
The problem is it will go a->b->c->a->b->c until it FLAG_COMPLETE goes up. After it will track back through ALL those calls in back order. Is there a way to avoid the return to caller function from the callee? I know in assembly this would be quite easy to do.
I am using C++ CLI. I want to avoid overflowing the stack by calling functions in a loop.