I have one more error it say (167): fatal error C1075: end of file found before the left brace '{' at 'c:\users\tracy\documents\visual studio 2010\projects\hello world\hello world\main.cpp(23)' was matched, and the code to fix it is this, I would like to say sorry for posting so many posts I just really wanted this code to finish super bad.
#include <iostream>
#include <string>
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:
{
std::string clanname;
std::getline( std::cin, clanname ); // <- gets one line of text from the user, puts it in "clanname" variable
std::cout << "your clan name is " << clanname;
}
break;
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;
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";
"To Go Back Press 0.\n";
// rest of code here
break;
case 3:
{
std::string clanname;
std::getline( std::cin, clanname ); // <- gets one line of text from the user, puts it in "clanname" variable
std::cout << "your clan name is " << clanname;
}
break;
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");
}
again im really sorry if I have been posting or bothering you to much! :(
2 more poped up after I fixed that one, here are what they say, 1>c:\users\tracy\documents\visual studio 2010\projects\hello world\hello world\main.cpp(21): warning C4101: 'choice' : unreferenced local variable
1>c:\users\tracy\documents\visual studio 2010\projects\hello world\hello world\main.cpp(168): fatal error C1075: end of file found before the left brace '{' at 'c:\users\tracy\documents\visual studio 2010\projects\hello world\hello world\main.cpp(98)' was matched, thanks for helping! Your awesome!
The first message is not an error message. It says that you defined variable choice but it is not used further in the code.
As for the second message then the number of open braces shall be equal to the number of closing braces. So check braces.