parent
ece23d11f2
commit
0a4981396f
@ -1,4 +1,4 @@
|
||||
32 0 0
|
||||
660 30.00 0
|
||||
5079 75.50 0
|
||||
32 0 0
|
||||
660 30.00 0
|
||||
5079 75.50 0
|
||||
8043 50.50 1
|
||||
|
@ -0,0 +1,26 @@
|
||||
//
|
||||
// Created by Mathéo Hersan on 16/10/2023.
|
||||
//
|
||||
|
||||
#include "client.h"
|
||||
|
||||
void afficherDonneesClient() {
|
||||
// Ouverture du fichier en mode lecture
|
||||
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");
|
||||
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");
|
||||
}
|
||||
|
||||
// Fermeture du fichier
|
||||
fclose(fichier);
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
//
|
||||
// Created by Mathéo Hersan on 16/10/2023.
|
||||
//
|
||||
|
||||
#ifndef SAE_101_CLIENT_H
|
||||
#define SAE_101_CLIENT_H
|
||||
|
||||
#include<stdio.h>
|
||||
#include<stdlib.h>
|
||||
|
||||
void afficherDonneesClient();
|
||||
|
||||
#endif //SAE_101_CLIENT_H
|
Loading…
Reference in new issue