http://www.cprogramming.com/tutorial/lesson5.html
Right at the bottom, it saysHow would I go about doing this? I suppose the do..while loop would be best, so I tried that and here's my best shot (it doesn't work):...you can make a loop around the whole thing to have it wait for valid input.
Thanks for all responses... I'm very new and learning the basics so please be kind!Code:#include <iostream> using namespace std; void playgame() { cout << "Play game called"; } void loadgame() { cout << "Load game called"; } void playmultiplayer() { cout << "Play multiplayer game called"; } int main() { int input; do { cout<<"1. Play game\n"; cout<<"2. Load game\n"; cout<<"3. Play multiplayer\n"; cout<<"4. Exit\n"; cout<<"Selection: "; cin>> input; switch ( input ) { case 1: // Note the colon, not a semicolon playgame(); break; case 2: // Note the colon, not a semicolon loadgame(); break; case 3: // Note the colon, not a semicolon playmultiplayer(); break; case 4: // Note the colon, not a semicolon cout<<"Thank you for playing!\n"; break; } } while (input=0); cin.get(); }