求助求助啊!!!

    技术2022-05-19  23

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

    #include<stdio.h>#include<malloc.h>#define MaxSize 100typedef 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");}


    最新回复(0)