X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=TP_13%2Fexo1%2Fsrc%2Fmain.c;h=a68e73cb2cbf5a1b87031357c576e11eb9521993;hb=b2129d81b38a22c9102a8fb3b66d317fc77c5c07;hp=2c81a631b28d3abb19c28c4eb6bf4d0ce3e0bd7f;hpb=889d586254feccc26f294af86ce7e698ea006dfb;p=TD_C.git diff --git a/TP_13/exo1/src/main.c b/TP_13/exo1/src/main.c index 2c81a63..a68e73c 100644 --- a/TP_13/exo1/src/main.c +++ b/TP_13/exo1/src/main.c @@ -17,9 +17,9 @@ int main() { do { display_choice_menu(); errno = prompt_value("Choix?", &choice); - handle_prompt_error(errno); - if (1 > choice || 7 < choice) { - printf("\nFaire un choix compris entre 1 et 7\n"); + handle_prompt_error(errno, tab); + if (1 > choice || 8 < choice) { + printf("\nFaire un choix compris entre 1 et 8\n"); continue; } switch (choice) { @@ -41,11 +41,14 @@ int main() { case 6: printf("\nLe nombre d'entiers impairs dans le tableau est %d\n", count_tab_criteria(tab, tab_size, is_odd)); break; + case 7: + do_resize(tab, &tab_size); + break; default: /* do nothing, unused code path */ break; } - } while (choice != 7); + } while (choice != 8); free_tab(tab); exit(EXIT_SUCCESS);