将文件全部读出来,再全部写到另一个文件
std::ifstream file("test.bin", std::ios_base::binary);//省略in
file.seekg(0, std::ios_base::end);//移动到文件末尾
unsigned long size = static_cast<unsigned long>(file.tellg());//获取文件大小
file.seekg(0, std::ios_base::beg);//移动到文件开始
char* bmp = new char[size];
file.read(bmp, size);
file.close();
std::ofstream file2("test_2.bin", std::ios_base::binary);//省略out
file2.write(bmp, size);
file2.close();