aboutsummaryrefslogtreecommitdiff
path: root/stack.h
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2021-12-11 20:18:16 +0100
committerHampusM <hampus@hampusmat.com>2021-12-11 20:18:16 +0100
commitaf4671acbc48446b0e0b3589b648854488f78e58 (patch)
tree46f6676c23b654749c7b173aa348f4c87f3b7044 /stack.h
parenta2bd411d2ee0e3242fc4345a98501283bc749e1c (diff)
refactor: fix formatting & move stack
Diffstat (limited to 'stack.h')
-rw-r--r--stack.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/stack.h b/stack.h
new file mode 100644
index 0000000..e6c6415
--- /dev/null
+++ b/stack.h
@@ -0,0 +1,19 @@
+#ifndef STACK_H
+#define STACK_H
+
+struct stack
+{
+ int max_size;
+ int top;
+ int *items;
+};
+
+struct stack *new_stack(int capacity);
+
+void stack_push(struct stack *pt, int x);
+
+int stack_peek(struct stack *pt);
+
+int stack_pop(struct stack *pt);
+
+#endif \ No newline at end of file