stack.h

来自「栈的应用—Polish Calculator」· C头文件 代码 · 共 17 行

H
17
字号
typedef double Stack_entry;

enum Error_code{underflow, overflow, success};



const int maxstack = 10;   //  small value for testing



class MyStack {

public:

   MyStack();

   bool empty() const;

   Error_code pop();

   Error_code top(Stack_entry &item) const;

   Error_code push(const Stack_entry &item);



private:

   int count;

   Stack_entry entry[maxstack];

};

⌨️ 快捷键说明

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