summaryrefslogtreecommitdiffhomepage
path: root/examples/demos.c
diff options
context:
space:
mode:
Diffstat (limited to 'examples/demos.c')
-rw-r--r--examples/demos.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/examples/demos.c b/examples/demos.c
index 7c5b9a4b..4cb50082 100644
--- a/examples/demos.c
+++ b/examples/demos.c
@@ -47,7 +47,7 @@ void vectordemo1()
cvec_ix_pop_back(&bignums); // erase the last
cvec_ix_erase_n(&bignums, 0, 1); // erase the first
- for (size_t i = 0; i < cvec_ix_size(bignums); ++i) {
+ for (size_t i = 0; i < cvec_ix_size(&bignums); ++i) {
printf("%" PRIuMAX ": %" PRIuMAX "\n", i, bignums.data[i]);
}
}
@@ -175,11 +175,11 @@ void mapdemo3()
cmap_str_iter it = cmap_str_find(&table, "Make");
c_foreach (i, cmap_str, table)
printf("entry: %s: %s\n", cstr_str(&i.ref->first), cstr_str(&i.ref->second));
- printf("size %" PRIuMAX ": remove: Make: %s\n", cmap_str_size(table), cstr_str(&it.ref->second));
+ printf("size %" PRIuMAX ": remove: Make: %s\n", cmap_str_size(&table), cstr_str(&it.ref->second));
//cmap_str_erase(&table, "Make");
cmap_str_erase_at(&table, it);
- printf("size %" PRIuMAX "\n", cmap_str_size(table));
+ printf("size %" PRIuMAX "\n", cmap_str_size(&table));
c_foreach (i, cmap_str, table)
printf("entry: %s: %s\n", cstr_str(&i.ref->first), cstr_str(&i.ref->second));
cmap_str_drop(&table); // frees key and value cstrs, and hash table.
@@ -200,7 +200,7 @@ void arraydemo1()
float *arr1 = arr3.data[5][4];
printf("arr3: %" PRIuMAX ": (%" PRIuMAX ", %" PRIuMAX ", %" PRIuMAX ") = %" PRIuMAX "\n", sizeof(arr3),
- arr3.xdim, arr3.ydim, arr3.zdim, carr3_f_size(arr3));
+ arr3.xdim, arr3.ydim, arr3.zdim, carr3_f_size(&arr3));
printf("%g\n", arr1[3]); // = 10.2
printf("%g\n", arr2[4][3]); // = 10.2