
c++
jwqu
这个作者很懒,什么都没留下…
展开
-
IO流循序渐进二
<br />#include "stdafx.h" #include <fstream> #include <iostream> #include <string> using namespace std; int _tmain(int argc, _TCHAR* argv[]) { ifstream in("d://1.txt",fstream::in | fstream::out ); string str; while( getline(in,str) ) //读取多行操原创 2010-09-25 20:23:00 · 323 阅读 · 0 评论 -
IO流循序渐进四
<br /> <br />ofstream out("d://1.txt",fstream::app);//在文件的末尾添加<br /> <br />ofstream out("d://1.txt",fstream::out)<br />ofstream out("d://1.txt",fstream::out | fstream::in)<br />ofstream out("d://1.txt",fstream::ate);<br />ofstream out("d://1.txt",fstream::原创 2010-09-25 21:50:00 · 692 阅读 · 0 评论 -
IO流循序渐进三
<br /><br />while( getline(in,str) )<br />{<br />cout << str << endl;<br />}<br /> <br />此getline,读取流in中的每一行并存储到str中区<br /> <br />----------------------------------------------------------------<br /> <br /><br />char c[10];<br /> <br />cin.getline(c,5,'e'原创 2010-09-25 20:36:00 · 382 阅读 · 0 评论 -
IO流循序渐进五
<br />#include "stdafx.h" #include <fstream> #include <sstream> #include <iostream> #include <vector> #include <string> using namespace std; int _tmain(int argc, _TCHAR* argv[]) { //将int型转换为string类型 stringstream stream; string result;原创 2010-09-26 20:21:00 · 525 阅读 · 0 评论