summaryrefslogtreecommitdiffhomepage
path: root/examples/stack.c
diff options
context:
space:
mode:
Diffstat (limited to 'examples/stack.c')
-rw-r--r--examples/stack.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/examples/stack.c b/examples/stack.c
index f65b9243..428f99a0 100644
--- a/examples/stack.c
+++ b/examples/stack.c
@@ -1,5 +1,5 @@
-#include <stdio.h>
+#include <stc/cfmt.h>
#include <stc/cstr.h>
#include <stc/cstack.h>
@@ -12,16 +12,16 @@ int main() {
cstack_i stack = cstack_i_init();
cstack_c chars = cstack_c_init();
- c_forrange (i, int, 101)
+ c_forrange (i, int, 101)
cstack_i_push(&stack, i*i);
- printf("%d\n", *cstack_i_top(&stack));
+ c_print(1, "{}\n", *cstack_i_top(&stack));
- c_forrange (i, int, 90)
+ c_forrange (i, int, 90)
cstack_i_pop(&stack);
-
+
c_foreach (i, cstack_i, stack)
- printf(" %d", *i.val);
+ c_print(1, " {}", *i.val);
puts("");
- printf("top: %d\n", *cstack_i_top(&stack));
+ c_print(1, "top: {}\n", *cstack_i_top(&stack));
} \ No newline at end of file