summaryrefslogtreecommitdiffhomepage
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/list.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/examples/list.c b/examples/list.c
index c9ec4a16..0da52c9b 100644
--- a/examples/list.c
+++ b/examples/list.c
@@ -20,11 +20,19 @@ int main() {
k = 0; c_foreach (i, clist_fx, list)
if (++k <= 10) printf("%8d: %10f\n", k, i.item->value); else break;
+ puts("");
clist_fx_clear(&list);
- c_push(&list, clist_fx, c_items(10, 20, 30, 40, 50));
- c_foreach (i, clist_fx, list) printf("%.1f ", i.item->value);
+ c_push(&list, clist_fx, c_items(10, 20, 30, 40, 30, 50));
+ c_foreach (i, clist_fx, list) printf(" %g", i.item->value);
+ puts("");
+
+ int removed = clist_fx_remove(&list, 30);
+ clist_fx_insert_after(&list, clist_fx_last(&list), 1000);
+ //clist_fx_insert_after(&list, clist_fx_before_begin(&list), 5);
+ clist_fx_push_front(&list, 5);
+ c_foreach (i, clist_fx, list)
+ printf(" %g", i.item->value);
puts("");
-
clist_fx_destroy(&list);
} \ No newline at end of file