summaryrefslogtreecommitdiffhomepage
path: root/examples
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2020-12-08 20:20:52 +0100
committerTyge Løvset <[email protected]>2020-12-08 20:20:52 +0100
commitbfd7248535ee2bc6c067cb56894966968dc1ee82 (patch)
tree2496237e6905492e1d36ea9d4bddc540675ddb02 /examples
parentc9456324d1122d0c6135db8f2feda1913dd2cf69 (diff)
downloadSTC-modified-bfd7248535ee2bc6c067cb56894966968dc1ee82.tar.gz
STC-modified-bfd7248535ee2bc6c067cb56894966968dc1ee82.zip
Added clone() to stack, cpqueue and queue.
Renamed erase_at() to erase_n() in cvec and cstr to improve consistency.
Diffstat (limited to 'examples')
-rw-r--r--examples/demos.c6
1 files changed, 3 insertions, 3 deletions
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]);