Is it possible to use the goto statement in C/C++ to jump to a label outside of the main function? Something like:
lab0: //First label
std::cout<<"Hello, ";
goto lab1;
lab1: //Second label
std::cout<<"World!";
goto lab2;
int main()
{
goto lab0;
lab2: //Third label
std::cout<<std::endl;
return 0;
}
Is there something I’m not getting about the goto and label statements?