#include class Istack { int sz; int top; int* stack; public: void init(int Nitems = 100) { sz = Nitems; stack = new int[sz]; top = sz; } void push(int x) { assert( !isfull() ); stack[--top] = x; } int pop() { assert( !isempty() ); return( stack[top++] ); } bool isempty() { return(( top == sz )); } bool isfull() { return(( top == 0)); } }; class Cstack { // Changed int sz; int top; char* stack; // Changed public: // init, push, and pop are changed void init(int Nitems = 100) { sz = Nitems; stack = new char[sz]; top = sz; } void push(char x) { assert( !isfull() ); stack[--top] = x; } char pop() { assert( !isempty() ); return( stack[top++] ); } bool isempty() { return(( top == sz )); } bool isfull() { return(( top == 0)); } };