Header File for Stack ADT - Pointer-based Implementation
#ifndef STACKPTR_H #define STACKPTR_H // ********************************************************* // Header file Stackptr.h for the ADT stack. // Pointer-based implementation. // ********************************************************* const int MAX_STACK = 50; typedef char stackItemType; class Stack { public: // constructors and destructor: Stack(); // default constructor Stack(const Stack& S); // copy constructor ~Stack(); // destructor // stack operations: int isEmpty(); int push(stackItemType NewItem); int pop(); int pop(stackItemType& StackTop); int top(stackItemType& StackTop); private: ptrType TopPtr; // pointer to item on top }; // end Stack class #endif // End of header file.
Email Me | Office Hours | My Home Page | Department Home | MCC Home Page