Ofstream的endl不好用怎么回事?

用endl,std::endl, " "都不好用,不输出换行,怎么回事?

【解决方法】

If you're writing a text file, you shouldn't be using the binary flag.

fout.open ("bodyfat.txt", ios::out | ios::app | ios::binary);

Remove the ios::binary. In text mode iostream will corectly map endl to for you.

 

原文地址:https://www.cnblogs.com/time-is-life/p/5660236.html