帮忙看一下这个程序错在哪里了?
typedef struct node{
int data;
struct node *next;
}SNode;
SNode *push_l(SNode *top)/*进栈*/
{ SNode *h,*p;
int c;
h=(SNode *)malloc(SNode));
scanf("%d",&c);
h->data=c;h->next='\0';
while(c!-1)
{ p=(SNode *)malloc(sizeof(SNode));
scanf("%d",&c);
p->data=c;
p->next=top; top=p;
}return top;
}
SNode *pop_l(SNode *top,int *y,int *flag)/*出栈*/
{ int p;
if(top) *flag=0;
else
{ p=top; *y=p->data;
top=p->next; free(p);
*flag=1;
return top;
}
}
SNode *print(SNode *top)/*打印栈中剩下的数据*/
{ SNode *p;
p=top;
printf("The left data inside stack is:\n");
printf("Head");
while(p)
{ printf("->%d",p->data);
p=p->next;
}
printf("->end!\n");
}
main()
{ SNode *h;
int *y,*f;
h=push_l(h);
h=pop_l(h,y,f);
if(f)
{ printf(The stack is empty!\n");
exit(0);
}
print(h);
printf("The data left stack is %d\n",*y);
}
上面是关于对栈的操作,但有几处错误,请高手指点一下,不盛感激呀。