English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I cant find the errors on my program

these are my errors


: 'CarOrFight' : local function definitions are illegal
: end of file found before the left brace '{' at 'U:\game.cpp(171)' was matched














#include
int Gas();
int Gun();
int CarOrFight();

int main()
{
cout <<"Your an agent\n\n";
cout << "The goverment sent you to investigate missing people in\nCosta Rico";
cout << "\n\nYour in the woods, you see houses every half a mile\n\n";
cout <<"Your partner, Alex, tells you that you are running out of gas";
cout <<"You want to get to the town soon to investigate, but you are afraid you will run out of gas\n\n";
cout <<"You noticed that you just passed a gas station\n\n";
cout <<"You can turn back choice 1 \n";
cout <<"\n\nor\n\n";
cout <<"Get to town before gas runs out choice 2\n";
Gas();
return 0;
}





int Gas()
{
enum Gas{turn=1,go};

int choice;
cin >> choice;
if (choice==turn)

2006-12-08 08:08:44 · 3 answers · asked by kevin h 1 in Computers & Internet Programming & Design

3 answers

We'll need the end of your code to help you...

2006-12-08 08:11:10 · answer #1 · answered by Anonymous · 0 0

Both errors are probably because you have a "{" (left brace) symbol but never put in the matching "}" (right brace) symbol, for example at the end of a function.

Go through your code and make sure every brace is in its place.

2006-12-08 08:16:28 · answer #2 · answered by rainfingers 4 · 2 0

Your post looks to be incomplete or cutoff. Regardless, I can tell you what to look for. You most like forgot a semi-colon at end of statement. Or you forgot a closing/opening parens or brace. Hopefully you are using a proper code editor to edit your code. Such editors will highlight your code and indent it properly.

2006-12-08 08:12:35 · answer #3 · answered by csanon 6 · 0 0

fedest.com, questions and answers