diff options
| author | Aldrik Ramaekers <aldrik@mailbox.org> | 2026-01-09 15:28:38 +0100 |
|---|---|---|
| committer | Aldrik Ramaekers <aldrik@mailbox.org> | 2026-01-09 15:28:38 +0100 |
| commit | 210404a73706993d197c1290d5a411394e176fbe (patch) | |
| tree | 93c3ea9fc4691ca42f26dd92c6e14627af0b47af /libs/simclist-1.5/examples/ex2.c | |
| parent | a65e876f3277a7d7fca6e5129ac3e200dae2d0dc (diff) | |
remove unused lib files
Diffstat (limited to 'libs/simclist-1.5/examples/ex2.c')
| -rw-r--r-- | libs/simclist-1.5/examples/ex2.c | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/libs/simclist-1.5/examples/ex2.c b/libs/simclist-1.5/examples/ex2.c deleted file mode 100644 index 3fc2c5e..0000000 --- a/libs/simclist-1.5/examples/ex2.c +++ /dev/null @@ -1,38 +0,0 @@ -#include <stdio.h> - -#include <simclist.h> - -int main() { - int val; - list_t l; - - list_init(&l); - - /* request to store copies, and provide the metric function */ - list_attributes_copy(&l, list_meter_int32_t, 1); - - printf("Give numbers. Terminate with one negative.\n"); - scanf("%d", &val); - while (val > 0) { - list_append(&l, &val); - scanf("%d", &val); - } - - /* setting the comparator, so the list can sort, find the min, max etc */ - list_attributes_comparator(&l, list_comparator_int32_t); - list_sort(&l, -1); /* sorting the list in descending (-1) order */ - - /* printing out the result */ - printf("Sorted values:\n"); - - list_iterator_start(&l); /* starting an iteration "session" */ - while (list_iterator_hasnext(&l)) { /* tell whether more values available */ - printf("%d\n", *(int *)list_iterator_next(&l)); /* get the next value */ - } - list_iterator_stop(&l); /* starting the iteration "session" */ - - list_destroy(&l); - - return 0; -} - |
