#include <stdio.h>
int main(void)
{
const char* filename = "d:\\date.bin";
double d1 = 627.9182;
FILE* fp = fopen(filename, "wb");
fwrite(&d1, sizeof d1, 1, fp);
fclose(fp);
fp = fopen(filename, "rb");
double d2;
fread(&d2, sizeof d2, 1, fp);
printf("%lf\n", d2);
fpos_t pos = 0;
fsetpos(fp,&pos);
double d3;
fread(&d3, sizeof d3, 1, fp);
printf("%lf\n", d3);
fclose(fp);
}
/*
run:
627.918200
627.918200
*/