问题:实现栈的基本操作,内容包括栈的结构体,栈的初始化,栈的销毁,进栈操作及出栈操作
//结构体
typedef struct MyStack
{
ElemType *top;
ElemType *base;
int stacksize;
}MyStack;
//
栈的初始化
MyStack* InitStack()
{
MyStack *stack;
stack = (MyStack *)malloc(sizeof(MyStack));
stack->stacksize = INIT_SIZE;
stack->base = (ElemType *)malloc(sizeof(ElemType)*INIT_SIZE);
stack->top = stack->base;
return stack;
}
//
栈的销毁
void DestroyStac