#include #include #define STACKSIZE 20 typedef char info_t; typedef struct s { info_t S[STACKSIZE]; int top; } stack; void init(stack *m) { m->top = -1; } void stackOverflow() { fprintf(stderr, "ERROR: StackOverFlow\n"); exit(-1); } void stackUnderflow() { fprintf(stderr, "ERROR: StackUnderFlow\n"); exit(-1); } void push(stack *m, info_t x) { if(m->top >= STACKSIZE) stackOverflow(); m->S[++(m->top)]=x; } info_t pull(stack *m) { if(m->top < 0) stackUnderflow(); return(m->S[(m->top)--]); } info_t Peek(stack *m) { if(m->top < 0) stackOverflow(); return(m->S[(m->top)]); } int isEmpty(stack *m) { return((m->top) < 0); } int main() { return 0; }