Hey again, I have another problem.
I wrote a function to hande my menu switch statement:
ResourceMgr.cpp
Code:
...
void ResourceMgr::vComputeMainMenuChoice()
{
std::cin >> m_iChoice; /*Wait for the user input(choice)*/
switch(m_iChoice) /*Pass the choice variable into a switch statement*/
{
case 1: /*If the user entered "1"...*/
/*Do this*/
break;
case 2: /*If the user entered "2"...*/
iExitApp(); /*...do this*/
break;
default: /*If the user didn't enter "1" or "2"...*/
vDisplayErrorMessage();
iExitApp();
break;
}
}
...
... Basically I want my application to exit where I use my function iExitApp():
ResourceMgr.cpp
Code:
...
int ResourceMgr::iExitApp()
{
vDisplayExitMessage();
return 0;
}
...
... to test this, I added an output statement at the end of main() to make sure it was working.... and guess what, it doesn't! It continues to do the rest of the statements in main() and then exits... I don't understand :S
Main.cpp
Code:
int main() /*define the main function*/
{
/*Instances of incorporated classes*/
ResourceMgr ResourceManager; /*Create an instance of ResourceMgr*/
ResourceManager.vComputeMainMenuChoice();
std::cout << "Test" << std::endl;
return 0; /*Return "All Good"*/
}
...My program outputs "Test" to the console and then exits..... what's the problem?