送交者: steven 于 2005-5-25, 03:27:53:
回答: save double type to file 由 neo6 于 2005-5-25, 01:26:36:
print the hex of the two integers, like fprintf (FP, "0x%08x 0x%08x", ip[0], ip[1]). Since you save the exact content of the double, nothing will ever lose. To retrive it, reverse it, fscanf (FP, "0x%x 0x%x", &ip[0], &ip[1]); and double x = *(double *)&ip[0];