Ofstream的endl不好用怎么回事?

用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.

 

上一篇:百度大脑UNIT3.0详解之嵌入式对话理解技术


下一篇:使用ThreadLocal实现的读写分离在迁移后的偶发错误