// Interface to Stack data type #include "Stack.h" #include void initStack(Stack *s) { s->top = 0; // (*s).top = 0; } int pushStack(Stack *s, Item val) { if (s->top == MAX_STACK) return 0; s->items[s->top] = val; s->top++; return 1; } Item popStack(Stack *s) { if (s->top == 0) return -1; s->top--; return s->items[s->top]; } int isEmptyStack(Stack s) { if (s.top == 0) return 1; else return 0; // return (s.top == 0) ? 1 : 0; // return (s.top == 0); } void showStack(Stack s) { printf("Base "); for (int i = 0; i < s.top; i++) { printf("%d ", s.items[i]); } printf("Top\n"); }