stack源代码//顺序栈基本运算算法
#include <stdio.h>
#include <malloc.h>
#define MaxSize 2
typedef char ElemType;
typedef struct
{
ElemType data[MaxSize];
int top; //栈指针
} SqStack; //顺序栈类型
void InitStack(SqStack *&s)
{
s=(SqStack *)malloc(sizeof(SqStack));
s->top=-1;
}