Signed-off-by: Mathéo Hersan <matheohersan@MacBook-Pro-de-Matheo.local>
pull/1/head
Mathéo Hersan 2 years ago
parent ece23d11f2
commit 0a4981396f
No known key found for this signature in database
GPG Key ID: 4EF19C64D78EC91B

BIN
app

Binary file not shown.

@ -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

@ -2,8 +2,10 @@
#include<stdlib.h>
#include "app/interface/interface_client.h"
#include "app/interface/interface_resp.h"
#include "app/core_logic/client.h"
int main(){
affiche_client();
afficherDonneesClient();
}

Loading…
Cancel
Save