Exemplo n.º 1
0
int _tmain(int argc, _TCHAR* argv[])
{
	CStack st;
	int list[5]={1,2,3,4,5};
	for(int i=0;i<5;i++)
	{
		st.Push(list[i]);
	}
	for(int i=0;i<5;i++)
	{
		cout <<st.Pop()<<endl;
	}
	for(int i=0;i<5;i++)
	{
		st.Push(list[i]);
	}
	st.Clear();
	if(st.IsEmpty())
		cout<<"stack is empty!";
	return 0;
}