求助求助啊!!!

来源:互联网 发布:kitti行人数据集 编辑:程序博客网 时间:2024/05/08 17:40

我是菜鸟,求助求助啊!!!错误在哪里

#include<stdio.h>
#include<malloc.h>
#define MaxSize 100
typedef char Elemtype;
typedef struct
{
 ElemType data[MaxSize];
 int top;
}SqStack;
void InitStack(SqStack * &s)
{
 s=(SqStack * )malloc(sizeof(SqStack));
 s->top=-1;
}
void ClearStack(SqStack * s)
{
 free(s);
}
int StackEmpty(SqStack * s)
{
 return(s->top==-1);
}
int Push(SqStack * &s,ElemType e)
{
 if(s->top==MaxSize-1)
  return 0;
 s->top++;
 s->data[s->top]=e;
 return 1;
}
int Pop(SqStack * &s,ElemType &e);
{
 if(s->top==-1)
  return 0;
 e=s->data[s->top];
 s->top--;
 return 1;
}
int Gettop(SqStack * s,ElemType &e)
{
 if(s-top==-1)
  return 0;
 e=s->data[s->top];
 return 1;
}
void DispStack(SqStack * s)
{
 int i;
 for(i=s->top;i>=0;i--)
  printf("%c",s->data[i]);
 printf("/n");
}

原创粉丝点击