c++读取txt文件
string fname = "a.txt"; string buf; fstream fp(fname ); while (!fp1.eof() && fp1.peek() != EOF){ getline(fp1, buf);// read one line } fp.close();
string fname = "a.txt"; string buf; fstream fp(fname ); while (!fp1.eof() && fp1.peek() != EOF){ getline(fp1, buf);// read one line } fp.close();