diff options
| author | tylo <[email protected]> | 2020-08-31 17:18:40 +0200 |
|---|---|---|
| committer | tylo <[email protected]> | 2020-08-31 17:18:40 +0200 |
| commit | 895ef5181d03a628d654aa8425aa05fa583f5bf9 (patch) | |
| tree | 1ebeb03e8196da198f3ff9cd4ae0a270ff0b4725 /examples | |
| parent | 83a648c1ea1ed71b767779ac604833bc2f4ef200 (diff) | |
| download | STC-modified-895ef5181d03a628d654aa8425aa05fa583f5bf9.tar.gz STC-modified-895ef5181d03a628d654aa8425aa05fa583f5bf9.zip | |
Updated clist iterators.
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/list.c | 14 |
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 |
