// ArrayStack.h // wdg 2009 #ifndef ARRAYSTACK_H #define ARRAYSTACK_H const int MAX_STACK = 100; typedef int StackType; const StackType ERROR = -1; class ArrayStack { public: ArrayStack( ); // constructor void push(StackType item); // pushes object onto stack bool isEmpty() const; // returns whether stack is empty or not StackType pop(); // pops top element from stack StackType peek() const; // returns value of data on top of stack void dump() const; // outputs representation on stdout private: StackType arr[MAX_STACK]; // stores data int count; // number of elements in stack // note that valid data always in 0..count-1 }; #endif