Ok, (1) I ogt my program to run and it works, thanks for the help! :) but there is a glitch in the system that I dont get why it is happening, in the menu when I start it up any section on the menu if I press to go in it it will show me what is inside the section but I had a button that would let me go back to the menu to press something else, one the button want let me type stuff in for some reason if you can help with that but, if I wait about 3-6 seconds something pops up on the screen and it says press enter to continue and there is no way on getting out of it so when I press enter it terminates the program. Have any ideas?
I have absolutely no idea what you are talking about. Is this following from another thread? Is it a GUI menu you're making? What is this "something" that pops up on screen?
I dont know what GUI mean :P, and this is a menu, and I am making it in c++, and if I open the start game section in about 5 seconds this pops up as a line of code like if I wrote it, Press Return To Continue, and there is no way to get out of it, so when I press return the program terminates. Thats it. Any other questions?
this pops up as a line of code like if I wrote it, Press Return To Continue, and there is no way to get out of it, so when I press return the program terminates. Thats it.
You're really not being very clear in your description. Is this in a console window? Is it a dialog? Something else?
How can we possibly help you if you don't properly explain to us what you're seeing?
#include <iostream>
usingnamespace std;
void menu (int& a)
{
cout << " 1 - Start Game.\n";
cout << " 2 - Online Multiplayer.\n";
cout << " 3 - Clans.\n";
cout << " 4 - Achievements.\n";
cout << " 5 - Downloadable Content.\n";
cout << " 6 - Settings.\n";
cout << " 7 - Exit.\n";
cout << " Enter your choice and press return: ";
cin >> a;
}
void decision(int& a)
{
int choice;
switch (a)
{
case 1: cout << "Heres the game!.\n";
cout << "To Go Back Press 0.\n";
cin >> a;
break;
case 2: cout << "Working on Multiplayer!\n";
cout << "To Go Back Press 0.\n";
// rest of code here
break;
case 3: cout << " Enter your clan name and press return: ";
break;
case 4: cout << "Noob: Play this game online/offline for an hour!\n";
cout << "Grenade Professional: Get two kills with one grenade!\n";
cout << "Pro Shooter: Get 100 head shots!\n";
cout << "Lets Play Online: Play one match online!\n";
cout << "Offline Professional: Beat offlie!\n";
cout << "Online Modes: Play one round on every mode online!\n";
cout << "Sniper Maddness: Play on sniper maddness 10 times!\n";
cout << "Battle: Play on battle 10 times!\n";
cout << "Team Battle: Play on team battle 10 times!\n";
cout << "Versus: Play on versus 10 times!\n";
cout << "To Go Back Press 0.\n";
// rest of code here
break;
case 5: cout << "Every thing is 99 cents\n";
cout << "Skin\n";
cout << "Gamer Point\n";
break;
case 6: cout << "Profile\n";
cout << "Gamer Points\n";
cout << "Skins\n";
cout << "Options\n";
break;
case 7: cout << "Exit\n";
break;
default: cout << "Not a Valid Choice. \n";
cout << "Choose again.\n";
break;
}
}
int main()
{
int choice;
bool gameOn = true;
menu(choice);
switch (choice)
{
case 1: cout << "Heres the game!.\n";
cout << "To Go Back Press 0.\n";
break;
case 2: cout << "Working on Multiplayer!\n";
cout << "To Go Back Press 0.\n";
// rest of code here
break;
case 3: cout << " Enter your clan name and press return: ";
break;
case 4: cout << "Noob: Play this game online/offline for an hour!\n";
cout << "Grenade Professional: Get two kills with one grenade!.\n";
cout << "Pro Shooter: Get 100 head shots!\n";
cout << "Lets Play Online: Play one match online!\n";
cout << "Offline Professional: Beat offlie!\n";
cout << "Online Modes: Play one round on every mode online!\n";
cout << "Sniper Maddness: Play on sniper maddness 10 times!\n";
cout << "Battle: Play on battle 10 times!\n";
cout << "Team Battle: Play on team battle 10 times!\n";
cout << "Versus: Play on versus 10 times!\n";
cout << "To Go Back Press 0.\n";
// rest of code here
break;
case 5: cout << "Every thing is 99 cents\n";
cout << "Skin\n";
cout << "Gamer Points\n";
cout << "To Go Back Press 0.\n";
break;
case 6: cout << "Profile\n";
cout << "Gamer Points\n";
cout << "Skins\n";
cout << "Options\n";
cout << "To Go Back Press 0.\n";
break;
case 7: "Exit\n";
break;
gameOn = false;
break;
default: cout << "Not a Valid Choice. \n";
cout << "Choose again.\n";
cin >> choice;
break;
}
system ("pause");
return 0;
}
So, can you try and explain clearly and precisely what it is that you're having trouble with?
Also, what's the point of your decision() function? It's never called anywhere, and it looks as though it just duplicates code that's in your main function.
OK let me try...... I run the program in Microsoft Visual Studio, ONCE I run the program I open up one of the menu sections lets say "Start Game" in start game there is a back button (it is disabled IDK why) it says press 0 then enter to go back to the menu so I can pick another section, after I wait about 4 seconds at the start game section THIS will pop up on my screen, (Press Return To Continue) and I haft to press return no matter what there is no option not to press it, so when I press it terminates the program so then I haft to rerun the program and try to fix the error, is that good enough???