我希望在C++中使用相当于C++的C语言:getline(std::cin,s); // reads an arbitrarily long line and// inserts its contents on schar* s;
getline(stdin,s); // allocates the space necessary to fit the read// line an
我想知道为什么我会得到错误:“重载函数的任何实例"getline”都不匹配参数列表,参数类型是( std::ifstream,int)“,”我确定"infile“是std::ifstream参数类型。infile.eof()) infile >> word; getline(infile, countLines); //issue area here
我正在使用C++中的getline()函数。我的编译器一直给我一个错误,getline()没有匹配的成员函数调用,我该如何解决这个问题?我在试着从档案里找出姓氏和分数。myFile.eof()) { getline(myFile,data); //reading data on linemyFile.getline(LastName, ' ');//storing data