私のコード:
void listall()
{
string line;
ifstream input;
input.open("registry.txt", ios::in);
if(input.is_open())
{
while(std::getline(input, line, "\n"))
{
cout<<line<<"\n";
}
}
else
{
cout<<"Error opening file.\n";
}
}
私は C++ を初めて使用し、テキスト ファイルを 1 行ずつ出力したいと考えています。Code::Blocks を使用しています。
それが私に与えるエラーは次のとおりです。
エラー: 'getline(std::ifstream&, std::string&, const char [2])' の呼び出しに一致する関数がありません