global.cpp

来自「一门课程的proj」· C++ 代码 · 共 36 行

CPP
36
字号
#include "StdAfx.h"
#include ".\global.h"

global::global(void)
{
}

global::~global(void)
{
}

void global::push(string a_n, string c, int a_v, int s_n)
{
	attribute *newAttr = new attribute(a_n, c, a_v, s_n);
	this->att.push(*newAttr);	
}

void global::getTop(attribute &dst)
{
	if( att.empty() )
		cout<<"ERROE:THE STACK IS EMPTY!!!!!!"<<endl;
	dst = att.top();
}

void global::popTop(attribute &dst)
{
	if( att.empty() )
		cout<<"ERROE:THE STACK IS EMPTY!!!!!!"<<endl;
	dst = att.top();
	att.pop();
}
void global::clear()
{
	while( !att.empty())
		att.pop();
}

⌨️ 快捷键说明

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