栈的基本操作 不懂问题在哪

问题遇到的现象和发生背景
用代码块功能插入代码,请勿粘贴截图

#include
#include

#define STACK_INIT_SIZE 100
#define STACKINCREMENT 10
#define OVERFLOW -2
#define OK 1
#define ERROR 0

typedef int ElemType;

typedef struct
{
SElemType *base;
SELemType *top;
int stacksize;
}SqStack;

void CreateStack_S(SqStack &s)//先创建一个栈,然后才能进行各种基本操作
{
S.base=(SElemType*)malloc(STACK_INIT_SIZE * sizeof(SElemType));
if(!S.base)exit(OVERFLOW);
S.top=S.base;
S.stacksize=STACK_INIT_SIZE;
return OK;
}

int Push(SqStack &S,SElemType&e)//入栈
if(S.top-S.base>=S.stacksize)
{
S.base=(SElemType*)realloc(S.base,(S.stacksize+STACKINCREMENT)*sizeof(SElemType));
if(!S.base)exit(OVERFLOW);
S.top=S.base+S.stacksize;
S.stacksize+=STACKINCREMENT;
}
*S.top++=e;
return OK;
}

int GetTop(SqStack S,SElemType &e)//获得栈顶元素
{
if(S.top==S.base)
return ERROR;
e=*(S.top-1);
return OK;
}

int Pop(SqStack&S,SElemType&e)//删除栈顶元素
{
if(S.top==S.base)return ERROR;
e=*--S.top;
return OK;
}

void DestoryStack(SqStack&s)//栈的销毁
{
free(S.base);
S.base=NULL;
S.top=NULL;
S.stacksize=0;
return OK;
}

int main()
{
int n,e,i;
SqStack S;
CreateStack_S(S);
printf("请输入元素个数\n");
scanf("%d",&n);
printf("请输入你的元素\n");
for(i=0;i
{
scanf("%d",&e);
Push(S e);
}
Get(S e);
printf("栈顶元素为:%d",e);
Pop(S e);
DestoryStack(S);
return 0;
}

运行结果及报错内容

img

typedef int ElemType;

typedef struct
{
SElemType *base;
SELemType *top;
int stacksize;
}SqStack;
你上面定义的是ElemType,不是SElemType啊