From bfd7248535ee2bc6c067cb56894966968dc1ee82 Mon Sep 17 00:00:00 2001 From: Tyge Løvset Date: Tue, 8 Dec 2020 20:20:52 +0100 Subject: Added clone() to stack, cpqueue and queue. Renamed erase_at() to erase_n() in cvec and cstr to improve consistency. --- examples/demos.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'examples') diff --git a/examples/demos.c b/examples/demos.c index 0355d32f..f5df2c00 100644 --- a/examples/demos.c +++ b/examples/demos.c @@ -14,7 +14,7 @@ void stringdemo1() cstr_insert(&cs, 3, "-two"); printf("%s.\n", cs.str); - cstr_erase_at(&cs, 7, 5); // -nine + cstr_erase_n(&cs, 7, 5); // -nine printf("%s.\n", cs.str); cstr_replace(&cs, cstr_find(cs, "seven"), 5, "four"); @@ -45,10 +45,10 @@ void vectordemo1() cvec_ix_push_back(&bignums, i * i); printf("erase - %d: %zu\n", 3, bignums.data[3]); - cvec_ix_erase_at(&bignums, 3, 1); // erase index 3 + cvec_ix_erase_n(&bignums, 3, 1); // erase index 3 cvec_ix_pop_back(&bignums); // erase the last - cvec_ix_erase_at(&bignums, 0, 1); // erase the first + cvec_ix_erase_n(&bignums, 0, 1); // erase the first for (size_t i = 0; i < cvec_size(bignums); ++i) { printf("%zu: %zu\n", i, bignums.data[i]); -- cgit v1.2.3