Menu non-stoppable (ajout while)

doc
Rémi LAVERGNE 2 years ago
parent 4cf977f459
commit eaf545a014

@ -18,6 +18,7 @@ int displayMenu(void)
printf("2. \u25B6 Inscription\n"); printf("2. \u25B6 Inscription\n");
printf("3. \u25B6 Faire opposition\n"); printf("3. \u25B6 Faire opposition\n");
printf("4. \u274C Quitter\n"); printf("4. \u274C Quitter\n");
printf("9. \u26A0 Débug\n");
printf("=================================\n"); printf("=================================\n");
printf("Votre choix : "); printf("Votre choix : ");
scanf("%d", &choice); scanf("%d", &choice);
@ -50,22 +51,30 @@ void global(void)
// Affichage du menu // Affichage du menu
choice = displayMenu(); choice = displayMenu();
switch (choice) while (choice != 4)
{ {
case 1: choice = displayMenu();
//TODO > Connexion switch (choice)
choice = displayMenu(); {
case 2: case 1:
//TODO > Inscription //TODO > Connexion
choice = displayMenu(); break;
case 3: case 2:
//TODO > Faire opposition //TODO > Inscription
choice = displayMenu(); break;
case 4: case 3:
return; //TODO > Faire opposition
default: break;
printf("Erreur, veuillez entrer un choix valide.\n"); case 4:
choice = displayMenu(); return;
case 9:
printf("Temp");
break;
default:
printf("Erreur, veuillez entrer un choix valide.\n");
choice = displayMenu();
break;
}
} }
} }

Loading…
Cancel
Save