求助 C 读一个文本文件提示段错误 找不出解决方法
plink read_mes(){
plink P,H =(plink)malloc(Size);
plink new_node;
FILE *fp = NULL;
if(NULL == H)
{
printf("ERROR:malloc error\n ");
return NULL;
}
P = H;
fp = fopen("stud.txt","rt+");
if(NULL == fp)
{
printf("ERROR:cannot open file!\n ");
return NULL;
}
while(!feof(fp))
{
new_node =(plink)malloc(Size);
if(NULL == new_node)
{
printf("ERROR:malloc error\n ");
return NULL;
}
P->next = new_node;
new_node->next = NULL;
P = new_node;
fscanf(fp,"%d,%s,%d,%f",&P->id,P->name,&P->age,&P->score);Debug时 在这里出现错误No source available for "vfscanf() at 0x1c1083"
}
fclose(fp);
return H;
}