I have a list of functions named as so, void F1()
, void F2()
.....
I ask the user to input a number and it will call the corresponding function.
So if they input 5
it will call F5()
.
Rather than having one really long switch statement, I am wondering is there a way to do this by appending the users input to the function call. Something like the below code
std::cout << "Please enter the number of the function you wish to call " << std::endl;
std::cin >> choice;
functionToCall = "F" + choice;