added all the verifications

Signed-off-by: Mathéo Hersan <matheohersan@MacBook-Pro-de-Matheo.local>
pull/3/head
Mathéo Hersan 2 years ago
parent dc6e30a070
commit 94037a556d
No known key found for this signature in database
GPG Key ID: 4EF19C64D78EC91B

BIN
app

Binary file not shown.

@ -195,7 +195,7 @@ void modifier_quantite_article_panier(int panier[], int quantites[], int *taille
while (getchar() != '\n'); while (getchar() != '\n');
printf("ERREUR : Veuillez entrer une référence valide (nombre) : "); printf("ERREUR : Veuillez entrer une référence valide (nombre) : ");
} }
while (getchar() != '\n'); // Nettoyer le tampon d'entrée while (getchar() != '\n');
int articleIndex = -1; int articleIndex = -1;
for (int i = 0; i < *taillePanier; i++) { for (int i = 0; i < *taillePanier; i++) {

@ -5,7 +5,7 @@
#define MAX_ARTICLES 100 #define MAX_ARTICLES 100
#define MAX_CLIENTS 100 #define MAX_CLIENTS 100
void affiche_client(int a) { void affiche_client() {
printf("\n"); printf("\n");
printf("+-------------+ \n"); printf("+-------------+ \n");
printf("|| Bonjour ! ||\n"); printf("|| Bonjour ! ||\n");
@ -25,8 +25,8 @@ void affiche_client(int a) {
/* /*
* Sert à lancer le menu et faire choisir l'utilisateur * Sert à lancer le menu et faire choisir l'utilisateur
*/ */
void menu_client(int *choix, int jour) { void menu_client(int *choix) {
affiche_client(jour); affiche_client();
printf("Vous choisissez: "); printf("Vous choisissez: ");
while (scanf("%d", choix) != 1 || *choix < 0 || *choix > 9) { while (scanf("%d", choix) != 1 || *choix < 0 || *choix > 9) {
while (getchar() != '\n'); while (getchar() != '\n');
@ -90,7 +90,7 @@ void global_client() {
} }
do{ do{
menu_client(&choix, jour); menu_client(&choix);
switch (choix) { switch (choix) {
case 1: case 1:

@ -1,5 +1,5 @@
#include<stdio.h> #include<stdio.h>
void affiche_client(int a); void affiche_client();
void menu_client(int *choix, int a); void menu_client(int *choix);
void global_client(); void global_client();
Loading…
Cancel
Save