#include "stdafx.h"
#include <iostream>
using namespace std;
/*struct Node
{
int elem;
Node *link;
};*/
class STACK
{
public:
STACK(int size); //栈初始空间,容量,栈顶
~STACK(); //回收内存
bool enqueue(int obj); //判满
bool outqueue(int &elem); //判空,出栈
void clear();
bool empty();
bool full();
int length();
void traverse();
private:
int *top; //栈顶指针
int m_size;
int m_length;
int ihead;
int itial;
};
STACK::STACK(int size)
{
m_size = size;
top = new int(m_size);
m_length = 0;
ihead = 0;
itial = 0;
}
STACK ::~STACK()
{
delete []top;
}
void STACK::clear()
{
m_leng