diff options
| author | Tyge Løvset <[email protected]> | 2020-09-09 10:09:18 +0200 |
|---|---|---|
| committer | Tyge Løvset <[email protected]> | 2020-09-09 10:09:18 +0200 |
| commit | eee239dadee4d599c279a7e24972d72c1edcce4d (patch) | |
| tree | a84b034cb0e7ea2a2208aa7aa85eee1aead1f3b9 /examples/list.c | |
| parent | 98d80fcef94ccd738173196dc3de0c889d847f28 (diff) | |
| download | STC-modified-eee239dadee4d599c279a7e24972d72c1edcce4d.tar.gz STC-modified-eee239dadee4d599c279a7e24972d72c1edcce4d.zip | |
More compliance with std:: containers.
Diffstat (limited to 'examples/list.c')
| -rw-r--r-- | examples/list.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/examples/list.c b/examples/list.c index 4eea5620..24dfc82f 100644 --- a/examples/list.c +++ b/examples/list.c @@ -31,8 +31,14 @@ int main() { clist_fx_insert_after(&list, clist_fx_before_begin(&list), 5); // same as push_front()
clist_fx_push_back(&list, 500);
clist_fx_push_front(&list, 1964);
+ clist_fx_iter_t it = clist_fx_before_begin(&list);
+ printf("Full: ");
c_foreach (i, clist_fx, list)
printf(" %g", i.item->value);
+ for (int i=0; i<4; ++i) clist_fx_next(&it);
+ printf("\nSubs: ");
+ c_foreach (i, clist_fx, it, clist_fx_end(&list))
+ printf(" %g", i.item->value);
puts("");
clist_fx_destroy(&list);
}
\ No newline at end of file |
