bool goToMenu()
{
char userChoice;
bool menu = true, askMenu = false;
int iteration = 0;
do
{
if (iteration>0)
{
cout << "Vous avez introduit un mauvais caractere." << endl;
}
cout << endl;
cout << " ================================" << endl;
cout << " | |" << endl;
cout << " | m : Menu Principal |" << endl;
cout << " | e : Quitter |" << endl;
cout << " | |" << endl;
cout << " ================================" << endl;
cout << endl;
cin >> userChoice;
if (userChoice == 'm')
{
menu = true;
askMenu = false;
}
else if (userChoice == 'e')
{
menu = false;
askMenu = false;
}
else
{
askMenu = true;
}
}
while (askMenu);
return menu;
}