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

 

posted on 2016-07-11 14:51  今夜太冷  阅读(471)  评论(0编辑  收藏  举报