while(!myfile.eof())
{getline(myfile,line_read);
if (name != line_read)
{
myfile << "\n";
myfile << name <<"\n";
}
}
Here is the code. My objective was to search through myfile, in a line by line manner and compare it to name. If it was not in the list, the program should add it to it.
Here is the error I get.
" error C2784: 'std::basic_istream<_Elem,_Traits> &std::getline(std::basic_istream<_Elem,_Traits> &,std::basic_string<_Elem,_Traits,_Alloc> &)' : could not deduce template argument for 'std::basic_istream<_Elem,_Traits> &' from 'std::ofstream'"
Thanks for any help provided. If more code is needed, please feel free to let me know and I will post it all.