#include <stdio.h>
int main(void)
{
int n;
FILE *fp;
fp = fopen("d:\\data.bin","rb");
if (!fp)
{
printf("Unable to open file");
return 1;
}
while( 1 )
{
fread(&n, sizeof(int), 1, fp);
if(feof(fp)) break;
printf("%d\n", n);
}
fclose(fp);
return 0;
}
/*
run: (the content of d:\\date.bin)
100
200
300
*/