您的位置:首页 > 其它

Ofstream的endl不好用怎么回事?

2016-07-11 14:51 218 查看
用endl,std::endl, "\n"都不好用,不输出换行,怎么回事?

【解决方法】

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 \r\n for you.

 
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: