1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
#include <stdlib.h> #include <stdio.h> #ifndef STACK_H #define STACK_H typedef int stackitem; typedef struct { int size; int maxsize; stackitem* start; } stack; stack* newstack(); stackitem pop(stack* s); stackitem peek(stack* s); void push(stack *s, stackitem si); #endif