X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=TP_11%2Fexo2%2Fui.c;h=7599780b4a88f37ade741213b249de17eca19ba0;hb=198615555e53390f89cab08e27faaaeb42c2ee6e;hp=998b8469cb4a45fbb503e8ca895b1b0d49e508fd;hpb=a5a969535fd998039f26ddab023a0a7153006d81;p=TD_C.git diff --git a/TP_11/exo2/ui.c b/TP_11/exo2/ui.c index 998b846..7599780 100644 --- a/TP_11/exo2/ui.c +++ b/TP_11/exo2/ui.c @@ -17,13 +17,9 @@ void displayArray(const int array[], unsigned length) { } void displayList(link_t* head) { - unsigned i = 0; - printf("--Begin--\n"); - while (head != NULL) { - printf("value at [%d]=%d\n", i, head->value); - head = head->next; - i++; + for (unsigned i = 0; i < list_count(head); i++) { + printf("value at [%d]=%d\n", i, list_get(head, i)); } printf("--End--\n"); }