My code right now:
std::string line;
std::fstream localFile;
localINIFile.open(MyToReadFile/*, std::ios::in || std::ios::out*/); // the MyToReadFile is declared somewhere else, and is being declared before this
if (localFile.is_open())
{
std::string Name = A[ID]; // ID is delcared somewhere else too
std::string lookFor = Name + " false";
while ( getline (localFile,line) )
{
if (line == lookFor)
{
// this is where I want to edit the current line
AddOutput = true; // also declared somewhere else
break;
}
}
localFile.close();
}
My problem is that I can't find anything about being able to change a line like:
// start of file
Line I don't care about
Also a line I don't care about
Line I care about and want to change
One more line I don't care about
and just one more line
// end of file
But I can't find anything about how to do it so my question is how could I possibly do it?