作者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