the simplest way is to cast the double into int*, then



所有跟贴·加跟贴·新语丝科技论坛

送交者: 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];



所有跟贴:


加跟贴

笔名: 密码(可选项): 注册笔名请按这里

标题:

内容(可选项):

URL(可选项):
URL标题(可选项):
图像(可选项):


所有跟贴·加跟贴·新语丝科技论坛