私は C++ std::stream が初めてで、いくつかのテストを行っています。私はこの簡単なコードを持っています:
int i = 10;
char c = 'c';
float f = 30.40f;
std::ofstream out("test.txt", std::ios::binary | std::ios::out);
if(out.is_open())
{
out<<i<<c<<f;
out.close();
}
ストリームは、ファイルに,とのバイナリ表現があるstd::ios::binary
と予想されるように開かれますが、代わりに.test.txt
i
c
f
10c30.4
私が間違っていることを教えてください。