12345678910
char temp; ofstream fout("good.txt",ios_base::out|ios_base::binary); ifstream fin("test.txt",ios_base::in|ios_base::binary); while(fin.read((char*)&temp,1)) fout.write((char*)&temp,1); fout.close(); fin.close();