PersonalCorpus 版 (精华区)
// Stack.h: interface for the Stack class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_STACK_H__A46FBE26_2CAB_4CEA_99C4_B55DE861D463__INCLUDED_)
#define AFX_STACK_H__A46FBE26_2CAB_4CEA_99C4_B55DE861D463__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include <iostream.h>
#include <stdlib.h>
const MaxStackSize = 50;
typedef char DataType;
class Stack
{
private:
// private data members. stack array, and top
DataType stacklist[MaxStackSize];
int top;
public:
Stack();
virtual ~Stack();
// stack modification operations
void Push (const DataType& item);
DataType Pop (void);
void ClearStack(void);
// stack access
DataType Peek (void) const;
// stack test methods
int StackEmpty(void) const;
int StackFull(void) const; // array implementation
};
#endif // !defined(AFX_STACK_H__A46FBE26_2CAB_4CEA_99C4_B55DE861D463__INCLUDED_)
Powered by KBS BBS 2.0 (http://dev.kcn.cn)
页面执行时间:3.362毫秒