what exactly are you trying to do? if you're just trying to copy a file from one spot to another, try this:
Code:
#include<fstream>
int main()
{
char ch;
std::fstream in("test.in",std::ios::binary|std::ios::in);
std::fstream out("test.out",std::ios::binary|std::ios::out|std::ios::trunc);
while(!in.eof())
{
in.read(reinterpret_cast<char*>(&ch),sizeof(ch));
out.write(reinterpret_cast<char*>(&ch),sizeof(ch));
}
in.close();
out.close();
return 0;
}
this block makes me think you need more practice with file I/O:
Code:
ofstream out ("out.mp3", ios::trunc);
out.close();
out.open("out.mp3", ios::app);
that and the fact that you're using binary methods on a non-binary stream. this is a great reference.