Unwanted Loop

May 6, 2012 at 5:52pm
I go It thanks.
Last edited on May 11, 2012 at 10:43am
May 6, 2012 at 5:58pm

1
2
3
4
5
6
7
8
9
10
//to Call your functions:
easy();
medium();
hard();

//Not

void easy();
void medium();
void hard();


You also have a semi-colon after your "diff" if statement, so yeah, you'll always goto diff.
Last edited on May 6, 2012 at 5:59pm
May 6, 2012 at 10:50pm
Ok so took out the "void"'s before my function call, but when i run it , there are build errors.
I use Microsoft Visual C++ Express 2010. It says :
1>------ Build started: Project: Game, Configuration: Debug Win32 ------
1> main.cpp
1>c:\users\hrikhu\documents\visual studio 2010\projects\game\game\main.cpp(18): error C3861: 'easy': identifier not found
1>c:\users\hrikhu\documents\visual studio 2010\projects\game\game\main.cpp(19): error C3861: 'medium': identifier not found
1>c:\users\hrikhu\documents\visual studio 2010\projects\game\game\main.cpp(20): error C3861: 'hard': identifier not found
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
So i took out the "{cout << "\n"; goto diff;}" line. Instead of the loop, the program just end.
I dont get it?
May 6, 2012 at 11:08pm
You should define the functions before you use them.
May 7, 2012 at 10:42am
So just move the easy() medium() and hard() fuctions before tbe main()?
May 7, 2012 at 10:58am
yes
Topic archived. No new replies allowed.