From 5db75ac97ecfe33ca6682a860eaf5d1a6b415ff7 Mon Sep 17 00:00:00 2001 From: Adrien VAN DAMME Date: Tue, 4 Apr 2017 22:52:21 +0200 Subject: [PATCH] Prbl Fichier --- VANDAMME28.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/VANDAMME28.c b/VANDAMME28.c index a80a224..5371a5e 100644 --- a/VANDAMME28.c +++ b/VANDAMME28.c @@ -590,7 +590,7 @@ long int rechercheClient(char nom[__STRLEN__], char prenom[__STRLEN__], FILE * c { client = malloc(sizeof(Client)); long int ofsetFileCurClient; - fseek(clientDatF, 0, SEEK_SET); + fseek(clientDatF, sizeof(unsigned long int)+sizeof(Bool), SEEK_SET); clearerr(clientDatF); //Clear EOF do { @@ -749,7 +749,7 @@ void clientBinToTXT(FILE * bin, FILE* txt) //=================================== void modificationClient(Client * client, FILE * clientDatF, FILE * clientTXTF) { int choix = 0; - char ** aModifier = {&client->adresse, &client->contact.telephne, &client->contact.email}; + char ** aModifier = {&client->adresse, &client->contact.telephone, &client->contact.email}; char ** aAfficher = {"Adresse", "Telephne", "E-mail"}; do { @@ -758,7 +758,7 @@ void modificationClient(Client * client, FILE * clientDatF, FILE * clientTXTF) printf("Erreur choix errone !\n"); printf("MODIFICATION CLIENT %s %s \n", client->nom, client->prenom); printf("1. Adresse\n2. Telephne\n3. E-mail\n"); - printf("Votre choix :");scanf("%d", &choix); + printf("Votre choix :");clean_keyboard();scanf("%d", &choix); }while(!(choix == 1 || choix == 2 || choix == 3)); printf("Modification %s :", aAfficher[choix-1]); if(choix == 1) @@ -775,6 +775,11 @@ void modificationClient(Client * client, FILE * clientDatF, FILE * clientTXTF) } cleanFgets(client->adresse.rue);cleanFgets(client->adresse.numero);cleanFgets(client->adresse.localite); cleanFgets(client->nom);cleanFgets(client->prenom); - + } + else + { + printf("Modification de %s :", aAfficher[choix-1]); + clean_keyboard(); + scanf("%s", aModifier[choix-1]); } }