I just can't get this menu to work!!!
What I want it to do is it will go to the menu right? well then I want it to ask for the user to enter 1, 2, or 3 and then it will go back to MAIN. It will locate the correct function and go to it. But it will just go right back to the MENU. So this is what appears on the prompt.Code:#include <iostream> using namespace std; int Menu(int pick); int NewGame(); int Online(); int Quit(); int main() { int pick=0; if (pick==0) cout<<Menu(pick); if (pick==1) cout<<NewGame(); if (pick==2) cout<<Online(); if (pick==3) cout<<Quit(); } int Menu(int pick) { cout<<"Welcome to SUPER GAME! \n"; cout<<"What Would You Like To Do: \n"; cout<<"1. New Game \n"; cout<<"2. Online \n"; cout<<"3. Exit \n"; cin>>pick; cout<<main(); } int NewGame() { int pick; cout<<"This Game Is Currently Under Construction! \n"; cin.get(); cout<<Menu(pick); } int Online() { int pick; cout<<"No Such Feature Currently Available! \n"; cin.get(); cout<<Menu(pick); } int Quit() { return 0; }
Welcome to SUPER GAME!
What Would You Like To Do:
1. New Game
2. Online
3. Quit
X (whatever number 1-3)
Welcome to SUPER GAME!
What Would You Like To Do:
1. New Game
2. Online
3. Quit
X (whatever number 1-3)
It just continues to repeat itself. Anybody know how I could make it stop doing that?
Now I tried switching the int pick=0; up top where i state the prototypes but that doesn't work either. Anyone know what to do?



LinkBack URL
About LinkBacks


