From af4671acbc48446b0e0b3589b648854488f78e58 Mon Sep 17 00:00:00 2001 From: HampusM Date: Sat, 11 Dec 2021 20:18:16 +0100 Subject: refactor: fix formatting & move stack --- stack.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 stack.h (limited to 'stack.h') 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 -- cgit v1.2.3-18-g5258