资源预览内容
第1页 / 共4页
第2页 / 共4页
第3页 / 共4页
第4页 / 共4页
亲,该文档总共4页全部预览完了,如果喜欢就下载吧!
资源描述
文件输入输出流:C+风格的文件输入输出流 疯狂代码 http:/www.CrazyCoder.cn/ :http:/www.CrazyCoder.cn/VC/Article13579.html 输出主要由重载的左移操作符()完成。 a表示将数据放入a对象中。 #include usingnamespacestd; intmain() istringstreamistr; istr.str(“156.7“); /上述两个过程可以简单写成istringstreamistr(“156.7“); couta; coutb; cout #include #include usingnamespacestd; intmain() ostringstreamostr; /ostr.str(“abc“);/如果构造的时候设置了字符串参数,那么增长操作的时候不会从结尾开始增加,而是修改原 有数据,超出的部分 增长 ostr.put(d); ostr.put(e); Page ostr #include #include usingnamespacestd; intmain() stringstreamostr(“ccc“); ostr.put(d); ostr.put(e); ostra; cout #include #include usingnamespacestd; intmain() stringstreamsstr; /-int转string- inta=100; stringstr; sstra; 2008-9-25 0:51:42 疯狂代码 http:/www.CrazyCoder.cn/
网站客服QQ:2055934822
金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号