I'm making a class that displays a message to the user and asks them if they want to return to the start of the program, but the message function is in a separate class from where my main() is located. How do I access the main() function from a different class?
This is an example of the stuff I want to do:
main.cpp file:
int main()
{
Message DisplayMessage;
DisplayMessage.dispMessage();
return 0;
}
Message.cpp file:
void dispMessage(void)
{
cout << "This is my message" << endl;
//now how do I call main again in the main.cpp file?
}
Thanks!