I've always used a do while statement along with some switches
but there's a few ways to do it. Most will say to make it so the exit just runs to the end of the main function and let it quit safely, in lengthy programs, i prefer to use the exit command.
ex:
Code:
int selection;
do
{
cout<< " (1) Do this \n";
cout<<" (2) Do that \n";
cout<<" (3) Exit \n";
}while(selection > 3 || selection < 1);
switch(selection)
{
case 1:
cout<<" bla \n\n";
case 2:
cout<<"bla bla \n\n";
case 3:
exit(0);
} //end switch
this is not the most proper way it's just how I usually do it. Hope this helps you.