📄 sqstack.cpp
字号:
// SqStack.cpp: implementation of the SqStack class.
//
//////////////////////////////////////////////////////////////////////
#include "SqStack.h"
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
SqStack::SqStack()
{
top=base=new Node;
}
SqStack::~SqStack()
{
}
bool SqStack::push(char e)
{ Node *p=new Node;
if(p==NULL)
{ cout<<"Stack is overflow"<<endl;
return false;
}
else
{ p->word=e;
p->next=top;
top=p;
return true;
}
}
bool SqStack::pop(char& e)
{
if(top==NULL)
{ cout<<"Stack is empty"<<endl;
return false;
}
else
{ Node *p=top;
top=top->next;
e=p->word;
delete p;
return true;
}
}
bool SqStack::StackEmpty()
{ return top==base;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -