#include <iostream>
#include <fstream>

using namespace std;

int main() {
fstream ifs("a.bmp", ios::binary | ios::in);
fstream ofs("a.bin", ios::binary | ios::out);

char c;
while ( ? ) {
ifs.get(c);
ofs.put(c);
}

return 0;
}

バイナリ型式でファイルをコピーしたいのですが、
この場合、ファイルの終端はどうやって検出するのでしょうか?

ifs.eof()は当然ダメでした