C++按照数据流逐行读取文本文件

#include
#include
#include
using namespace std;
int main()
{
ifstream fin;
fin.open("word.txt");
string str;
while (!fin.eof())

{
getline(fin, str);
cout << str<< endl;
}
fin.close();
}

猜你喜欢

转载自blog.csdn.net/qq_35718950/article/details/83780800