作者freeway999 (freeway)
看板C_and_CPP
標題[問題] 浮點數的檔案輸出
時間Mon Oct 26 21:30:03 2009
請教各位前輩,
如果我想要把浮點數用4個BYTE儲存到檔案,
不要用字元的方式儲存,
這樣該怎麼寫呢?
謝謝。
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 61.62.111.67
1F:推 QQ29:fwrite + google 10/26 21:33
2F:推 VictorTom:1.0f要存binary 0x3F800000這種?? 直接fwrite出去吧@_@" 10/26 21:33
3F:推 poloball:out.write((char*)&data,sizeof(float)) 10/28 01:21
4F:→ poloball:out是output stream 10/28 01:22