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.
【解决方法】
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.
相关文章推荐
- [改善Java代码]注意方法中传递的参数要求(replaceAll和replace的区别)
- PAT-乙级-1007. 素数对猜想 (20)
- 这周工作
- python虚拟环境
- Search in Rotated Sorted Array
- Jrebel For Android 破解过程
- 第十次课总结及思考
- 超级素数
- PAT乙级练习题B1045. 快速排序
- 安装spark1.3.1单机环境
- html 混合布局
- Go语言的for和switch
- Webx Json输出源码
- Android App 分享功能实现
- ubuntu 安装json库
- hdu3410-Passing the Message(RMQ,感觉我写的有点多此一举。。。其实可以用单调栈)
- C语言学习之路(二)数据类型基本知识点
- Unity UI检测碰撞
- Spring表达式语言SpEL
- GPU内存压缩技术