下面这个程序:
#include<stdio.h>
#include<stdlib.h>
struct student
{
int num;
float score;
struct student *next;
};
int main()
{
struct studet *p[4],*head,*pt;
p[0]=(struct student *)malloc(1000);
pt=head=p[0];
for(int i=0;i<=2;i++)
{
p[i+1]=(struct student * )malloc(1000);
scanf("%ld %f",&p[i+1]->num,&p[i+1]->score);
p[i]->next=p[i+1];
}
p[3]->next=NULL;
while(pt!=NULL)
{
printf("%d %f\n",pt->num,pt->score);
pt=pt->next;
}
return 0;
}
调试的时候显示是在指针数组那个地方出了问题,求大神指教