#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) ) //读取多行操作 { cout << str << endl; } return 0; }