以下是引用us1688在2006-12-23 10:42:33的发言:
#include<stdio.h>
unsigned long name[4];
main()
{
FILE *fp;
int i;
if((fp=fopen("hzk24","rb+"))==NULL)
{
printf("Cannot open file strike any key exit!");
getch();
exit(1);
}
for(i=0;i<4;i++)
fread(&name[i],40,5,fp);/*感觉这里有问题*/
printf("\n\nname\tnumber age ss addr\n");
printf("%lu %lu %lu %lu %lu\n",name[0],name[1], name[2],name[3],name[4]);
fclose(fp);
}
程序能运行
但还有错误提示
null pointer assignment
?????????
----------------解决方案--------------------------------------------------------