modulestack.cpp
来自「test the resut l llke mjhue hbjhw hhww」· C++ 代码 · 共 24 行
CPP
24 行
#include "Floorplan.h"ModuleStack::ModuleStack(unsigned int nCapacity) { size = nCapacity; array = new int[size]; // ints will serve as pointers here tos = 0;}ModuleStack::~ModuleStack() { delete array;}Module * ModuleStack::pop() { (tos==0) ? tos = 0 : tos--; return (Module *) array[tos];}void ModuleStack::push(Module * mod) { array[tos] = (int) mod; tos++;}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?