/* Copyright (c) 1997 Oxford University Press. All Rights Reserved. This code is from "Data Structures via C++: Objects by Evolution", published by Oxford University Press. Permission is hearby granted to use this code for any educational, non-commercial purpose, provided this notice remains intact. A. Michael Berman, Rowan University, berman@rowan.edu http://www.rowan.edu/evolve */ // RCS $Id: cx8-1.h,v 1.1 1997/08/07 21:50:04 berman Exp $ // cx8-1.h Header File // Code Example 8-1: Stack implemented using an Array #ifndef __MB_CX8_1__ #define __MB_CX8_1__ //#include "dslib.h" const int maxStackSize = 1000; typedef char StackElementType; class Stack { public: Stack(); void push(StackElementType item); StackElementType pop(); StackElementType top(); bool isEmpty(); private: StackElementType stackArray[maxStackSize]; int topIndex; }; #endif