俺哩程序错哪儿了?
#include<stdio.h>#include<malloc.h>
void main(){
struct student{
int data;
struct student *next;
}STUDENT;
STUDENT *h=(STUDENT *)malloc(sizeof(STUDENT));
h->next=NULL;
for(int i=1;;i++){
STUDENT *p=(STUDENT *)malloc(sizeof(STUDENT));
scanf("%d",&p->data);
if(p->data=-1)break;
p->next=h->next;
h->next=p;
}
STUDENT *q=h->next;
do{
printf("%d",q->data);
q++;
}while(q->next!=NULL);
}
注:编译无错,但不能运行。