• Advertisement

Archived

This topic is now archived and is closed to further replies.

Gamesmaster still needs your help

This topic is 5127 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Alright I'm working on this example in my book.I don't know if the guy deliberately set up the program to give you errors or what but at first it started with about 22.Now I widdled it down to 2 errors but I can't figure out what they could be referring to.If you can please help me. Alright I went ahead and copied and pasted it again. The two errors are: C:\Snailraces.cpp(82) : error C2601: 'race' : local function definitions are illegal and C:\Snailraces.cpp(99) : fatal error C1075: end of file found before the left brace '{' at 'C:\Snailraces.cpp(82)' was matched #include #include <ctime> using namespace std; //function declarations int main(void); int race(int,int); void race(void); int menu(void); int placeBet(int); void ini(void); //variables int money = 200; //displays the main menu and //returns the user's selection int menu(void) { int userResponse; cout <<"You have " <> userResponse; } while(userResponse < 0 && userResponse > 4); return userResponse; } //decides how much money you will bet on the snail int placeBet(int userResponse) { int betAmount; cout<<"Snail " <> betAmount; return betAmount; } //if they are just watching the race? void race(void) { race(0,0); } //the main function int main(void) { ini(); int userResponse; cout <<"Welcome to the snail races!!!"<[edited by - Gamesmaster26 on February 7, 2004 3:49:47 PM]

Share this post


Link to post
Share on other sites
Advertisement
The compiler is telling you EXACTLY what is wrong.

Look on line 82. There''s a left brace there. That left brace does not have a matching right brace.

Actually, look on your main function. It also doesn''t have a matching right brace, after the return.

Share this post


Link to post
Share on other sites
Alright I think I might have it.I placed another } bracket to close up the main function I don't have any errors but I have a warning that not all the command paths are returning a value.

Ahhh man once I build it it gives me a error that says
Error Executing Link.exe

hehehe Now I see why so many programmers suffer from male pattern baldness



I try to quit but they -aww who am I kidding I''m addicted-

[edited by - Gamesmaster26 on February 7, 2004 3:33:17 PM]

Share this post


Link to post
Share on other sites
loads of errors in that code, copy and paste it from VC++ and use code tags !

''A library consists of the actual binary code behind the API. You link your game code to the library to make everything work.''

Share this post


Link to post
Share on other sites
Trust me that''s what I did.I copied it from vc++ and then pasted it here.When I compiled it it this time I got no errors but a warning saying that not all command paths have a value.Then when I go to build it it gives me an error telling me it has an error executing link.exe.

Believe me the code was far worse before because the author had most of the includes and function prototypes in the middle of the program.When I typed it just as the author had it it had 22 errors!

I don''t want to go on until I get this thing right and understand why it messing up to begin with.

Share this post


Link to post
Share on other sites
*Knocks self over the HEAD*

Alright it worked!!! Thanks alot!
The program was running without me knowing it.

I try to quit but they -aww who am I kidding I''''m addicted-

Share this post


Link to post
Share on other sites

  • Advertisement