其他语言
本类阅读TOP10
作者:未知 来源:月光软件站 加入时间:2005-6-5 月光软件站
前一阵子用C++写东西,需要往文件里写数据,很简单的代码,大概是这个样子:
#include <fstream>using namespace std;
int _tmain(int argc, _TCHAR* argv[]){ ofstream fout; fout.open("d:\\test.dat"); int a = 0x7788;
fout.write((char*) &a, sizeof(int));}
打开test.dat,内容是77 88 00 00,很正常。
相关软件: