64,281
社区成员
发帖
与我相关
我的任务
分享
ofstream hfile;
hfile.open("D:\\vs2013\\test1.txt");
//hfile << "他大姨妈";
hfile.close();
ifstream hfile2("D:\\vs2013\\test1.txt");
char line[256];
if (!hfile2.is_open())
{
cout << "Error opening file"; exit(1);
}
while (!hfile2.eof()) {
hfile2.getline(line, 100);
cout << line << endl;
}