From bf9914308497839c1d05905f6f156ee4165fdae1 Mon Sep 17 00:00:00 2001 From: Franciszek Malinka Date: Mon, 19 Apr 2021 10:18:30 +0200 Subject: Linked list finally working --- Semestr 4/sieci/pracownia2/router/test.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'Semestr 4/sieci/pracownia2/router/test.c') diff --git a/Semestr 4/sieci/pracownia2/router/test.c b/Semestr 4/sieci/pracownia2/router/test.c index ebc6df1..e086e55 100644 --- a/Semestr 4/sieci/pracownia2/router/test.c +++ b/Semestr 4/sieci/pracownia2/router/test.c @@ -27,11 +27,18 @@ int main() { int val = 0; scanf("%d", &val); insert(&list, &val, sizeof(int)); + reset(&list); } if (t == 1) { - erase(&list); + iterate(&list); + if (list.it != NULL) + printf("it: %d\n", *(int *)list.it->data); + else printf("End of list.\n"); } if (t == 2) { + erase_it(&list); + } + if (t == 3) { print_list(list); } } -- cgit v1.2.3