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

📄 stack.h

📁 我学习C++ Primer Plus过程中写下的课后作业的编程代码
💻 H
字号:
// stack.h -- class declaration for the stack ADT
typedef unsigned long Item;

class Stack
{
private:
	enum {MAX = 10};		//constant specific to class
	Item * pitems;			// holds stack items
	int size;				// number of elements in stack
	int top;				// index for top stack item
public:
	Stack(int n = 10);		// crates stack with n elements
	Stack(const Stack & st);
	~Stack();
	bool isempty()const;
	bool isfull()const;
	// push() returns false if stack already is full, true otherwise
	bool push(const Item & item);	// add item to stack
	// pop() returns false if stack already is empty, true otherwise
	bool pop(Item & item);			// pop top into item
	Stack & operator = (const Stack & st);
};

⌨️ 快捷键说明

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