repositories
/
TD_C.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5553a75
)
TP11 exo2: Respect the specification for displayList() function
author
Jérôme Benoit
<jerome.benoit@piment-noir.org>
Tue, 7 Mar 2017 19:40:32 +0000
(20:40 +0100)
committer
Jérôme Benoit
<jerome.benoit@piment-noir.org>
Tue, 7 Mar 2017 19:40:32 +0000
(20:40 +0100)
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
TP_11/exo2/ui.c
patch
|
blob
|
blame
|
history
diff --git
a/TP_11/exo2/ui.c
b/TP_11/exo2/ui.c
index 998b8469cb4a45fbb503e8ca895b1b0d49e508fd..7599780b4a88f37ade741213b249de17eca19ba0 100644
(file)
--- 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");
}