各位大侠看看这段代码对.wav文件的复制结果为什么不成功??
#include<iostream>#include<fstream>
using namespace std;
void main()
{
ifstream fin("D:\\123.wav",ios::binary);
if(!fin)
{
cout<<"File open error!\n";
return;
}
ofstream fout("D:\\bb\\123.wav",ios::binary);
char c[1024];
while(!fin.eof())
{
fin.read(c,1024);
fout.write(c,fin.gcount());
}
fin.close();
fout.close();
cout<<"Copy over!\n";
}