diff options
Diffstat (limited to 'rushs/evalexpr/stack/stack.c')
| -rw-r--r-- | rushs/evalexpr/stack/stack.c | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/rushs/evalexpr/stack/stack.c b/rushs/evalexpr/stack/stack.c deleted file mode 100644 index 0498abc..0000000 --- a/rushs/evalexpr/stack/stack.c +++ /dev/null @@ -1,30 +0,0 @@ -#include "stack.h" - -#include <stdlib.h> - -struct stack *stack_push(struct stack *s, int e) -{ - struct stack *new = malloc(sizeof(struct stack)); - new->data = e; - new->next = NULL; - - new->next = s; - return new; -} - -struct stack *stack_pop(struct stack *s) -{ - if (s == NULL) - { - return NULL; - } - - struct stack *res = s->next; - free(s); - return res; -} - -int stack_peek(struct stack *s) -{ - return s->data; -} |
