1 /* Roy Keene 2 CS 2314 3 Section 04 4 Lab 03 5 03 Sept 02 6 stack.h 7 */ 8 9 #include <iostream> 10 11 using namespace std; 12 13 #ifndef _STACK_STACKSIZE 14 #define _STACK_STACKSIZE 100 15 #endif 16 17 #define _STACK_GROWABLE 1 18 19 class Stack { 20 public: 21 Stack(void); 22 ~Stack(void); 23 void Push(int data); 24 int Pop(void); 25 int Top(void); 26 bool Empty(void); 27 bool Full(void); 28 private: 29 #ifndef _STACK_GROWABLE 30 int StackData[_STACK_STACKSIZE]; 31 int StackLocation; 32 #else 33 int *StackData; 34 int StackLocation; 35 unsigned int StackSize; 36 #endif 37 }; |