stack.cpp

来自「JICHERNG继承的实现」· C++ 代码 · 共 47 行

CPP
47
字号
// Stack.cpp: implementation of the Stack class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "Stack.h"

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

Stack::Stack()
{

}

Stack::~Stack()
{

}

void Stack::EnterStack(int newData)
{
	this->putHead(newData);
}

void Stack::QuitStack()
{
	this->getHead();
}

int Stack::peekTop()
{
    return this->peekHead();
}

void Stack::printStack()
{
   cout<<"Stack member:"<<endl;
   list<int>::iterator j;
   for(j=dataLinkHead;j!=dataLinkTail;j++)
   {
    cout<<"| "<<*j<<" |"<<endl;
   }
   cout<<"----"<<endl;
}

⌨️ 快捷键说明

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