I am having alittle issue with a function.

I'm trying to call a function from another one and instead of running the function and returning back to the previous one. its not running it and going straight to the end of the main function.... im trying to call it from a switch statement. Could someone please help! thanks
If you post the code I'll have a look.
How much of those code do you need, its over 400 lines atm.

I tried making it a void function since all it does is print out some information on demand. That didn't appear to help.

Here is a snippet of just this one case, if you cant figure it out from that i can post the entire section:

1
2
3
case 6: cout << "Now displaying player status window...\n\n";
			void PlayerStatusDisplay ();
			break;



@m4ster r0shi


Originally i had it without void which is what i did to call Game() which works fine from main but when i try the same thing outside main it doesnt work i get error

error C3861: 'PlayerStatusDisplay': identifier not found


Main() > Game() > PlayStatusDisplay() > Game() is what i want.


That must mean that im not defining it, but isn't that having

int PlayerStatusDisplay()
{
statements;
return 0;
}


the defining it?


or do i need to put

void PlayerStatusDisplay (void);

within the Game() function to define it?
Last edited on
The switch statement and the called function's body would be a good place to start, I guess.
Just the code where you call the first function, and the definitions of both functions.

EDIT: You don't need to specify void when calling the function.
Last edited on
You're not calling the function there... You're declaring it... Remove the void keyword.
WOOT victory for me i figured out my mistake!!! yay i now got an active character stats window to display the heros stats / exp / gold / atk / def/ etc and it can be called from each scene under the system status menu.
Topic archived. No new replies allowed.