ifstream infile("business.txt");
ofstream outfile("tmp.txt");
string line;
string serach;
while (!infile.eof()){
infile >> search;
int size = search.size();
infile.seekg(-size, ios::cur);
getline(infile, line,'\n');
if (search != name)
outfile << line <<endl;
}
为什么这个循环始终无法结束 难道不是getline了最后一行之后文件指针到达末端结束循环吗