|
|
|
@ -4,21 +4,20 @@
|
|
|
|
|
|
|
|
|
|
#include "client.h"
|
|
|
|
|
|
|
|
|
|
void afficherDonneesClient() {
|
|
|
|
|
FILE *fichier = fopen("donnee/client.txt", "r");
|
|
|
|
|
int numeroClient;
|
|
|
|
|
float cagnotte;
|
|
|
|
|
int suspendu;
|
|
|
|
|
|
|
|
|
|
if (fichier == NULL) {
|
|
|
|
|
fprintf(stderr, "Erreur lors de l'ouverture du fichier");
|
|
|
|
|
void chargerClient(int tNumClient[], float tCagnotte[], int tSus[], int *tLogique)
|
|
|
|
|
{
|
|
|
|
|
FILE *fic;
|
|
|
|
|
int i;
|
|
|
|
|
fic = fopen("donnee/client.txt", "r");
|
|
|
|
|
if (fic == NULL)
|
|
|
|
|
{
|
|
|
|
|
perror("fopen");
|
|
|
|
|
exit(EXIT_FAILURE);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
while (fscanf(fichier, "%d%f%d", &numeroClient, &cagnotte, &suspendu) == 3) {
|
|
|
|
|
printf("Client %d, Cagnotte %.2f, Suspendu: %s\n",
|
|
|
|
|
numeroClient, cagnotte, (suspendu == 0) ? "Non" : "Oui");
|
|
|
|
|
while (fscanf(fic, "%d %f %d", &tNumClient[*tLogique], &tCagnotte[*tLogique], &tSus[*tLogique]) != EOF)
|
|
|
|
|
{
|
|
|
|
|
(*tLogique)++;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fclose(fichier);
|
|
|
|
|
fclose(fic);
|
|
|
|
|
}
|