diff --git a/src/main.c b/src/main.c index b069129..d853ef5 100644 --- a/src/main.c +++ b/src/main.c @@ -57,7 +57,7 @@ void modifyClient(void) scanf("%c%*c", &choice); } // Faire une recherche du numéro client - fscanf("%d%f%d", &numClient, &cagnotte_add, &suspended); + fscanf(client, "%d%f%d", &numClient, &cagnotte_add, &suspended); while(!feof(client)) { if (numClient == searchedNumClient) @@ -80,6 +80,8 @@ void modifyClient(void) cagnotte += cagnotte_add; // Ecrire la modif } + + fscanf(client, "%d%f%d", &numClient, &cagnotte_add, &suspended); } fclose(client); return; diff --git a/src/main.h b/src/main.h index 2c0c241..533d856 100644 --- a/src/main.h +++ b/src/main.h @@ -12,8 +12,8 @@ //! TRAITEMENT DES FICHIERS void chargeDonnees(int reference[], float weight[], float volume[], float unitPrice[], int clientID[], float cagnotte[], int suspended[]); -void chargeArticles(int reference[], float weight[], float volume[], float unitPrice[]); -void chargeClients(int clientID[], float cagnotte[], int suspended[]); +int chargeArticles(int reference[], float weight[], float volume[], float unitPrice[]); +int chargeClients(int clientID[], float cagnotte[], int suspended[]); void sauvegardeDonnees(int reference[], float weight[], float volume[], float unitPrice[], int clientID[], float cagnotte[], int suspended[]); void sauvegardeArticles(int reference[], float weight[], float volume[], float unitPrice[]); diff --git a/src/traitement.c b/src/traitement.c index 17500e9..ca2f11e 100644 --- a/src/traitement.c +++ b/src/traitement.c @@ -11,7 +11,7 @@ void chargeDonnees(int reference[], float weight[], float volume[], float unitPr chargeClients(clientID, cagnotte, suspended); } -void chargeArticles(int reference[], float weight[], float volume[], float unitPrice[]) +int chargeArticles(int reference[], float weight[], float volume[], float unitPrice[]) { FILE *article; article = fopen("articles.txt","r"); @@ -47,7 +47,7 @@ void chargeArticles(int reference[], float weight[], float volume[], float unitP return tL; } -void chargeClients(int clientID[], float cagnotte[], int suspended[]) +int chargeClients(int clientID[], float cagnotte[], int suspended[]) { FILE *client; client = fopen("clients.txt","r");