From 5c03cf2fbbb6f27805992f17a4fabbefc7090a04 Mon Sep 17 00:00:00 2001 From: bastien Date: Sun, 4 May 2025 20:03:44 +0000 Subject: [PATCH] =?UTF-8?q?Actualiser=20solution=5Fcomment=C3=A9es=5Ffin?= =?UTF-8?q?=5Fexo=5F4/main.c?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- solution_commentées_fin_exo_4/main.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/solution_commentées_fin_exo_4/main.c b/solution_commentées_fin_exo_4/main.c index 388c138..799b9bc 100644 --- a/solution_commentées_fin_exo_4/main.c +++ b/solution_commentées_fin_exo_4/main.c @@ -34,7 +34,7 @@ #define CHOIX_AJOUTER 1 // Option pour ajouter un contact #define CHOIX_AFFICHER 2 // Option pour afficher les contacts #define CHOIX_RECHERHER 4 // Option pour rechercher (non implémentée) -#define CHOIX_QUITTER 27 // Option pour quitter le programme +#define CHOIX_QUITTER 3 // Option pour quitter le programme /** * Structure pour stocker un numéro de téléphone @@ -163,10 +163,9 @@ int main() { default: printf("Choix invalide, veuillez réessayer.\n"); } - } while (choix != 3); // ATTENTION: Incohérence avec CHOIX_QUITTER=27 - - // Libération de la mémoire (MANQUANTE dans le code original !) - // free(contacts); // Cette ligne devrait être ajoutée + } while (choix != 3); + + free(contacts); return 0; }