⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 c06p296.txt

📁 Data Abstraction & Problem Solving with C++源码
💻 TXT
字号:
// *********************************************************// Header file StackP.h for the ADT stack.// Pointer-based implementation.// *********************************************************#include "StackException.h"typedef desired-type-of-stack-item StackItemType;class Stack{public:// constructors and destructor:   Stack();                     // default constructor   Stack(const Stack& aStack);  // copy constructor   ~Stack();                    // destructor// stack operations:   bool isEmpty() const;   void push(StackItemType newItem);   void pop() throw(StackException);   void pop(StackItemType& stackTop) throw(StackException);   void getTop(StackItemType& stackTop) const                                   throw(StackException);private:   struct StackNode              // a node on the stack   {      StackItemType item;        // a data item on the stack      StackNode    *next;       // pointer to next node   };  // end struct   StackNode *topPtr; // pointer to first node in the stack};  // end Stack class// End of header file.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -