Is there a way to call a goto statement using a variable in the place of a label name?
I'm looking for something similar to this (this doesn't work for me):
// std::string or some other type that could represent a label
void callVariable(std::string name){
goto name;
}
int main(){
first:
std::cout << "Hi";
callVariable(first);
return 0;
}
I am not actually using this, I am more interested in learning.