been getting this error everytime i’ve tried to use getline with a delimiter. Please help!
vector<string> readRecordFromFile(string file_name, string search_term)
{
vector<string> record;
ifstream file;
file.open(file_name);
bool found_record = false;
string field_one;
string field_two;
string field_three;
while (getline(file, field_one, ",") && !found_record)
{
}
}
getline works if the third argument is removed, but i need to use a delim
>Solution :
Just replace getline(file, field_one, ",") with getline(file, field_one, ',') because the third argument should be a char and not a string literal.