From cc46697f12b18225b2efc62b4ee2af9172658415 Mon Sep 17 00:00:00 2001 From: "louis.germain" Date: Wed, 18 Oct 2023 19:00:19 +0200 Subject: [PATCH] =?UTF-8?q?r=C3=A9glage=20de=20divers=20bugs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/display.c | 6 +++--- src/main.h | 8 ++++---- src/modif.c | 2 +- src/traitement.c | 14 ++++++-------- 4 files changed, 14 insertions(+), 16 deletions(-) diff --git a/src/display.c b/src/display.c index f9bb2d8..2819da1 100644 --- a/src/display.c +++ b/src/display.c @@ -1,17 +1,17 @@ #include "main.h" -void displayItem(int reference[], float weight[], float volume[], float unitPrice[], int tlog) +void displayItem(int tabReference[], float weight[], float volume[], float unitPrice[], int tlog) { int reference, index; printf("Entrez la référence de l'article cherché: "); scanf("%d", &reference); - index = recherche(reference, reference[], tlog); + index = recherche(reference, tabReference, tlog); if (index == -1) { printf("La référence cherchée n'existe pas"); exit(1); } - printf("%d\t%f\t%f\t%f", reference[index], weight[index], volume[index], unitPrice[index]); + printf("%d\t%f\t%f\t%f", tabReference[index], weight[index], volume[index], unitPrice[index]); } void displayItemList(int reference[], float weight[], float volume[], float unitPrice[], int tlog) diff --git a/src/main.h b/src/main.h index c2b1f4b..7dce7bb 100644 --- a/src/main.h +++ b/src/main.h @@ -16,13 +16,13 @@ void chargeDonnees(int *tLogArticle, int *tLogClient,int reference[], float weig int chargeArticles(int reference[], float weight[], float volume[], float unitPrice[]); int chargeClients(int clientID[], float cagnotte[], int suspended[]); -void sauvegardeDonnees(int *tLogArticle, int *tLogClient, int reference[], float weight[], float volume[], float unitPrice[], int clientID[], float cagnotte[], int suspended[]); -void sauvegardeArticles(int reference[], float weight[], float volume[], float unitPrice[]); -void sauvegardeClients(int clientID[], float cagnotte[], int suspended[]); +void sauvegardeDonnees(int tLogArticle, int tLogClient, int reference[], float weight[], float volume[], float unitPrice[], int clientID[], float cagnotte[], int suspended[]); +void sauvegardeArticles(int reference[], float weight[], float volume[], float unitPrice[], int tLogArticle); +void sauvegardeClients(int clientID[], float cagnotte[], int suspended[], int tLogClient); //! GESTION CLIENTS void inputClient(void); -void modifyClient(void); +void modifyClient(int clientID[], float cagnotte[], int suspended[], int tlog); //! GESTION STOCKS void inputItem(void); diff --git a/src/modif.c b/src/modif.c index b3d25df..25b94f0 100644 --- a/src/modif.c +++ b/src/modif.c @@ -33,7 +33,7 @@ void modifyClient(int clientID[], float cagnotte[], int suspended[], int tlog) scanf("%d%*c", &numClient); index = recherche(numClient, clientID, tlog); printf("Entrez la modification voulue (s pour suspendre ou réactiver, c pour ajouter à la cagnotte)"); - scanf("%c"; &modif); + scanf("%c", &modif); if (modif == 's') if (suspended[index] == 0) suspended[index] = 1; diff --git a/src/traitement.c b/src/traitement.c index d44c6d7..1b342bd 100644 --- a/src/traitement.c +++ b/src/traitement.c @@ -9,7 +9,7 @@ int recherche(int val, int tab[], int tlog) // Recherche de l'index d'un id (de client ou d'article) { int i; - for (i=0, i