求一个读写二进制文件VC源程序,简单点就行,能读,能写

来源:百度知道 编辑:UC知道 时间:2024/05/16 07:10:08
帮我找一个例子也行

#include <fstream>
using namespace std;
int main()
{
fstream fsctrl;
fsctrl.open("C:\\read.txt",ios::in|ios::binary);
if(!fsctrl)
{
return -1;
}
string str;
fsctrl >> str;
fsctrl.close;
fsctrl.open("C:\\write.txt",ios::out|ios::binary);
if(!fsctrl)
{
return -1;
}
fsctrl << str;
fsctrl.close;
system("pause");
return 0;
}

253073323@qq.com 局域网传音乐的。。。里面读写音乐文件,2进制方式