Fix de quelques bugs

doc
Rémi LAVERGNE 2 years ago
parent 2fba475d23
commit 2e737c5731

@ -57,7 +57,7 @@ void modifyClient(void)
scanf("%c%*c", &choice); scanf("%c%*c", &choice);
} }
// Faire une recherche du numéro client // 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)) while(!feof(client))
{ {
if (numClient == searchedNumClient) if (numClient == searchedNumClient)
@ -80,6 +80,8 @@ void modifyClient(void)
cagnotte += cagnotte_add; cagnotte += cagnotte_add;
// Ecrire la modif // Ecrire la modif
} }
fscanf(client, "%d%f%d", &numClient, &cagnotte_add, &suspended);
} }
fclose(client); fclose(client);
return; return;

@ -12,8 +12,8 @@
//! TRAITEMENT DES FICHIERS //! TRAITEMENT DES FICHIERS
void chargeDonnees(int reference[], float weight[], float volume[], float unitPrice[], int clientID[], float cagnotte[], int suspended[]); 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[]); int chargeArticles(int reference[], float weight[], float volume[], float unitPrice[]);
void chargeClients(int clientID[], float cagnotte[], int suspended[]); 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 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[]); void sauvegardeArticles(int reference[], float weight[], float volume[], float unitPrice[]);

@ -11,7 +11,7 @@ void chargeDonnees(int reference[], float weight[], float volume[], float unitPr
chargeClients(clientID, cagnotte, suspended); 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; FILE *article;
article = fopen("articles.txt","r"); article = fopen("articles.txt","r");
@ -47,7 +47,7 @@ void chargeArticles(int reference[], float weight[], float volume[], float unitP
return tL; return tL;
} }
void chargeClients(int clientID[], float cagnotte[], int suspended[]) int chargeClients(int clientID[], float cagnotte[], int suspended[])
{ {
FILE *client; FILE *client;
client = fopen("clients.txt","r"); client = fopen("clients.txt","r");

Loading…
Cancel
Save