int main(void)
{
FILE *fp;
int i, j;
/*********Found************/
if ((fp=fopen("d:\\bi.dat", "wb+")) == NULL)//你打开的只能写,不能读取,要读取
{
exit (1);
}
printf("input 5 numbers:");
for (i=0; i<5; i++)
{
scanf("%d", &j );
/*********Found************/
fwrite(&j, sizeof(int), 1, fp);//地址,非数值
}
rewind(fp);
for(i=0; i<5; i++)
{
j = getw(fp);
printf("%d\t", j);
}
fclose(fp);
return 0;
}