My code:
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"; } } I’m new to C++, and I want to print out a text file line-by-line. I’m using Code::Blocks.
The error it gives me is:
error: no matching function for call to 'getline(std::ifstream&, std::string&, const char [2])'