入栈时出现未经处理的错误
这是相关代码
```c
typedef struct //创建顺序栈
{
int* base;
int* top;
int stacksize;
}SqStack;
bool InitStack(SqStack* &s)//初始顺序栈
{
s = (SqStack*)malloc(MAXSIZE * (sizeof(SqStack)));
s->base = (int*)malloc(MAXSIZE * (sizeof(int)));
s->top = (int*)malloc(MAXSIZE * (sizeof(int)));
if (!s->base)
{
return false;
}
s->top = (int*)-1;
s->stacksize = MAXSIZE;
return true;
}
//入栈
bool Push(SqStack* &s, int e)
{
if (s->top - s->base == s->stacksize) //栈满
{
return false;
}
*s->top++ = e; //将元素e压入栈顶,栈顶指针加1
return true;
}
这是入口