博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
入门计划->使用(C++库)ostringstream输出(格式化) (转)
阅读量:2502 次
发布时间:2019-05-11

本文共 1187 字,大约阅读时间需要 3 分钟。

入门计划->使用(C++库)ostringstream输出(格式化) (转)[@more@]

原创+收藏

 

//awzzz@2002 //计划->使用(C++库)ostringstream输出(格式化) //APO->using ostringstream. //accnce project of using ostringstream.(c++ iostream library) /* Reference: http://www.cplusplus.com/ref/iostream/ostringstream/ Description ostringstream class provides an interface to manipulate strings as if they were output streams. The s of this class mantain internally a pointer to a stringbuf object that can be obtained/modified by calling member ruf. This streambuf-derived object stores a sequence of characters (string) that can be obtained/modified by calling member str. */ //使用(C++库)ostringstream输出(格式化) //simple example #include #include #include using namespace std; void test() { //ostringstream oss; //oss.str("abc"); ostringstream oss("abc"); cout << oss.str() << endl; oss << 8 << endl; oss << 3.14 << endl; oss << " ok ." << endl; cout << oss.str() << endl; oss << 8 << " " << 3.14 << " " << " ok ." << endl; cout << oss.str() << endl; } int main(int argc, char* argv[]) { test(); return 0; }

 

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/10748419/viewspace-961103/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/10748419/viewspace-961103/

你可能感兴趣的文章
iOS 如何放大按钮点击热区
查看>>
ios设备唯一标识获取策略
查看>>
获取推送通知的DeviceToken
查看>>
Could not find a storyboard named 'Main' in bundle NSBundle
查看>>
CocoaPods安装和使用教程
查看>>
Beginning Auto Layout Tutorial
查看>>
block使用小结、在arc中使用block、如何防止循环引用
查看>>
iPhone开发学习笔记002——Xib设计UITableViewCell然后动态加载
查看>>
iOS开发中遇到的问题整理 (一)
查看>>
Swift code into Object-C 出现 ***-swift have not found this file 的问题
查看>>
为什么你的App介绍写得像一坨翔?
查看>>
RTImageAssets插件--@3x可自动生成@2x图片
查看>>
iOS开发的一些奇巧淫技
查看>>
linux的挂载的问题,重启后就挂载就没有了
查看>>
docker原始镜像启动容器并创建Apache服务器实现反向代理
查看>>
docker容器秒死的解决办法
查看>>
管理网&业务网的一些笔记
查看>>
子网掩码
查看>>
eclipse安装插件的两种方式在线和离线
查看>>
linux下源的相关笔记(suse)
查看>>