Im trying to run fuctions inside of 3 cases (case1,case2,case3) but when i run the code nothing happens so ive been trying to reseach how you put a function inside of a case correctly in c++ but iv ehad no luck.
Ive tried to run the code inside of the cases without linking to the functions and it works but for the outcomes i need to link a caseto a function.
switch (choice)
//wont run case functions
{
case 1:
void getnames();
break;
case 2:
void getNumber();
break;
case 3:
cout << "End of Program.\n";
break;
default:
cout << "Not a Valid Choice. \n";
cout << "Choose again.\n";
break;
}
The result i need is that the program will run the fuctions when the right number is inputed the program runs fine but it just keeps looping the menus and does not run the functions