帮忙看看链表怎么只输出一个数,且有警告
#include<stdio.h>#include<stdlib.h>
struct stu{
int date;
struct stu *next;
};
void main(void)
{
struct stu *h,*s,*w;
h=(struct stu*)malloc(sizeof(struct stu));
s=(struct stu*)malloc(sizeof(struct stu));
h->next=s;
s->date=1;
s=(struct stu*)malloc(sizeof(struct stu));
s->date=2;
s->next='\0';
w=h->next;
while((w->next)!='\0')
{
printf("%d",w->date);
w=w->next;
}
}