From 4cf977f4596e10ea84bc177bf3dd27862f99f70a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20LAVERGNE?= Date: Fri, 20 Oct 2023 16:32:22 +0200 Subject: [PATCH] =?UTF-8?q?Correction=20probl=C3=A8me=20de=20conversion=20?= =?UTF-8?q?(int=20>=20float)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modif.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/modif.c b/src/modif.c index 6bac13c..1bb7986 100644 --- a/src/modif.c +++ b/src/modif.c @@ -45,7 +45,8 @@ void modifyClient(int clientID[], float cagnotte[], int suspended[], int tlog) +var montant: montant à ajouter à la cagnotte +var modif: modification à exécuter sur le client */ - int index, numClient, montant; + int index, numClient; + float montant; char modif; printf("Entrez le numéro du client dont vous voulez modifier les données: "); scanf("%d%*c", &numClient); @@ -70,7 +71,7 @@ void modifyClient(int clientID[], float cagnotte[], int suspended[], int tlog) else if (modif == 'c') { printf("Entrez le montant à ajouter à la cagnotte: "); - scanf("%d", &montant); + scanf("%f", &montant); cagnotte[index] += montant; } }