#include
#include
int main()
{
std::fstream fin, fout;
fin.open("data1.bin", std::fstream::in | std::fstream::binary);
fout.open("data2.bin", std::fstream::out | std::fstream::binary);
int num;
while(fin.read((char*)&num, sizeof(int))) {
fout.write((char*)&num, sizeof(int));
}
fout.close();
fin.close();
return 0;
}