求教/(ㄒoㄒ)/~为什么总是提醒我error C2146: syntax error : missing ';' before identifier 'Pop
#include<stdio.h>#include<stdlib.h>
#include<malloc.h>
#define TRUE 1
#define FALSE 0
#define OK 1
#define ERROR 0
#define OVERFLOW -1
#define NULL 0
typedef int status;
typedef int Elemtype;
typedef struct node
{
Elemtype data;
struct node *next;
} LinkStack;
Status PopLinkStack(LinkStack *top,Elemtype &e)
{
LinkStack *p;
if(EmptyLinkStack(top))
{
printf("Stack Underflow");
return OVERFLOW;
}
else
{
y=top->data;
p=top;
top=top->next;
free(p);
return OK;
}
}
LinkStack * InitLinkStack(LinkStack *top)
{
top=NULL;
return top;
}
int EmptyLinkStack(LinkStack *top)
{
if(top==NULL)
return TRUE;
else
return FALSE;
}
LinkStack * PushLinkStack(LinkStack *top,Elemtype e)
{
LinkStack *p;
p=(LinkStack *)malloc(sizeof(LinkStack));
p->data=e;
p->next=top;
top=p;
return top;
}
Status GetTop(LinkStack *top,Elemtype &e)
{
if(EmptyLinkStack(top))
{
printf("Stack Underflow");
return OVERFLOW;
}
else
{
y=top->data;
return OK;
}
}
int main()
{
int quit=1,k;
Elemtype e;
LinkStack *top=NULL;
InitLinkStack(top);
printf("1.压栈\n2.弹栈\n3.判断栈空\n4.取栈顶元素\n5.退出\n");
scanf("%d",&k);
while(1)
{
switch(k)
{
case 1:
{
printf("请输入压栈的数字:");
scanf("%d",&e);
PushLinkStack(top,e);
break;
}
case 2:
{
if(PopLinkStack(S)==1)
printf("弹栈数据%d",e);
else
printf("弹栈失败");
break;
}
case 3:
{
if(EmptyLinkStack(S))
printf("空栈");
else
printf("栈非空");
break;
}
case 4:
{
if(GetTop(top,e)==1)
printf("栈顶元素%d",e);
else
printf("栈空");
break;
}
case 5:
{
return 1;
}
}
}