summaryrefslogtreecommitdiffhomepage
path: root/misc/examples/stack.c
diff options
context:
space:
mode:
author_Tradam <[email protected]>2023-09-08 01:29:47 +0000
committerGitHub <[email protected]>2023-09-08 01:29:47 +0000
commit3c76c7f3d5db3f9586a90d03f8fbb02d79de9acd (patch)
treeafbe4b540967223911f7c5de36559b82154f02f3 /misc/examples/stack.c
parent0841165881871ee01b782129be681209aeed2423 (diff)
parent1a72205fe05c2375cfd380dd8381a8460d9ed8d1 (diff)
downloadSTC-modified-modified.tar.gz
STC-modified-modified.zip
Merge branch 'stclib:master' into modifiedHEADmodified
Diffstat (limited to 'misc/examples/stack.c')
-rw-r--r--misc/examples/stack.c32
1 files changed, 0 insertions, 32 deletions
diff --git a/misc/examples/stack.c b/misc/examples/stack.c
deleted file mode 100644
index c817e1ae..00000000
--- a/misc/examples/stack.c
+++ /dev/null
@@ -1,32 +0,0 @@
-
-#include <stdio.h>
-
-#define i_tag i
-#define i_capacity 100
-#define i_val int
-#include <stc/cstack.h>
-
-#define i_tag c
-#define i_val char
-#include <stc/cstack.h>
-
-int main() {
- cstack_i stack = {0};
- cstack_c chars = {0};
-
- c_forrange (i, 101)
- cstack_i_push(&stack, (int)(i*i));
-
- printf("%d\n", *cstack_i_top(&stack));
-
- c_forrange (i, 90)
- cstack_i_pop(&stack);
-
- c_foreach (i, cstack_i, stack)
- printf(" %d", *i.ref);
- puts("");
- printf("top: %d\n", *cstack_i_top(&stack));
-
- cstack_i_drop(&stack);
- cstack_c_drop(&chars);
-}