summaryrefslogtreecommitdiffhomepage
path: root/examples/words.c
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2020-10-26 20:25:03 +0100
committerTyge Løvset <[email protected]>2020-10-26 20:25:03 +0100
commit0b95e794fe91b69928bb111d66fc973d18de7a1f (patch)
tree35843d6e5f17e07a3cbb3f8b59df4965661a35d8 /examples/words.c
parent0c64199a35a8901a4969f8c2ce0c0483f184732c (diff)
downloadSTC-modified-0b95e794fe91b69928bb111d66fc973d18de7a1f.tar.gz
STC-modified-0b95e794fe91b69928bb111d66fc973d18de7a1f.zip
Updates examples using cfmt.h c_print().
Diffstat (limited to 'examples/words.c')
-rw-r--r--examples/words.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/words.c b/examples/words.c
index fb8b9b8c..b72251c6 100644
--- a/examples/words.c
+++ b/examples/words.c
@@ -1,5 +1,5 @@
-#include <stc/cstr.h>
+#include <stc/cfmt.h>
#include <stc/cmap.h>
#include <stc/clist.h>
#include <stc/cvec.h>
@@ -18,7 +18,7 @@ int main1()
});
clist_str_push_back(&lwords, cstr_from_fmt("%f", 123897.0 / 23.0));
c_foreach (w, clist_str, lwords)
- printf("%s\n", w.val->str);
+ c_print(1, "{}\n", w.val->str);
puts("");
cvec_str words = cvec_INIT;
@@ -32,7 +32,7 @@ int main1()
cmap_si_emplace(&word_map, w.val->str, 0).first->second += 1;
c_foreach (i, cmap_si, word_map) {
- printf("%d occurrences of word '%s'\n", i.val->second, i.val->first.str);
+ c_print(1, "{} occurrences of word '{}'\n", i.val->second, i.val->first.str);
}
cmap_si_del(&word_map);