From cdbec2b91f35f149c37dfdc29b9fc13c41f29981 Mon Sep 17 00:00:00 2001 From: ngwalang Date: Fri, 13 Oct 2023 10:03:20 +0200 Subject: [PATCH] Correction d'erreur --- SCR3.1/TP6/max.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/SCR3.1/TP6/max.c b/SCR3.1/TP6/max.c index 0ff555c..cccdac3 100644 --- a/SCR3.1/TP6/max.c +++ b/SCR3.1/TP6/max.c @@ -41,17 +41,17 @@ int main(int argc, char **argv){ demi_f[i].n1 = duels[i*2].max; demi_f[i].n2 = duels[i*2+1].max; demi_f[i].max = 0; - pthread_create(&threads[i], NULL, max, (void*) (duels + i)); + pthread_create(&threads[i], NULL, max, (void*) (demi_f + i)); } for (int i = 0; i < 2;i++){ pthread_join(threads[i], NULL); } - numbers finale = {0}; + numbers finale = {}; finale.n1 = demi_f[0].max; finale.n2 = demi_f[1].max; pthread_create(&threads[0], NULL, max, (void*) (&finale)); pthread_join(threads[0], NULL); - printf("Le plus grand des huits nombres est : %d", finale.max); + printf("Le plus grand des huits nombres est : %d\n", finale.max); return EXIT_SUCCESS; }