// Chap 6, pp 263 - 264 // Rename this file as StackP.h // ********************************************************* // Header file StackP.h for the ADT stack. // Pointer-based implementation. // ********************************************************* #ifndef STYPE typedef int stackItemType; // desired-type-of-stack-item #define STYPE #endif struct stackNode; // defined in implementation file typedef stackNode* ptrType; // pointer to node #include "boolean.h" class stackClass { public: // constructors and destructor: stackClass(); // default constructor stackClass(const stackClass& S); // copy constructor ~stackClass(); // destructor // stack operations: boolean StackIsEmpty(); void Push(stackItemType NewItem, boolean& Success); void Pop(boolean& Success); void GetStackTop(stackItemType& StackTop, boolean& Success); private: ptrType TopPtr; // points to top of stack }; // end class // End of header file.