#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
?????????