《文件输入输出流c++风格的文件输入输出流》由会员分享,可在线阅读,更多相关《文件输入输出流c++风格的文件输入输出流(4页珍藏版)》请在金锄头文库上搜索。
1、文件输入输出流:C+风格的文件输入输出流 疯狂代码 http:/www.CrazyC :http:/www.CrazyC 输出主要由重载的左移操作符()完成。 a表示将数据放入a对象中。 #include usingnamespacestd; intmain() istringstreamistr; istr.str(“156.7“); /上述两个过程可以简单写成istringstreamistr(“156.7“); couta; coutb; cout #include #include usingnamespacestd; intmain() ostringstreamostr; /ost
2、r.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.CrazyC