hi
i have a file with this text in it : "hi , how are you? are you ok?"
i want add a word like TODAY after "are" without lose other words.
how can do it?
i do not want use temp file.
This is a discussion on Question about file within the C++ Programming forums, part of the General Programming Boards category; hi i have a file with this text in it : "hi , how are you? are you ok?" i ...
hi
i have a file with this text in it : "hi , how are you? are you ok?"
i want add a word like TODAY after "are" without lose other words.
how can do it?
i do not want use temp file.
Last edited by aminpost; 12-01-2009 at 10:11 AM.
read contents of the file into string, modify string, write string back to file
If I have eight hours for cutting wood, I spend six sharpening my axe.
like this?Code:std::string test = "a"; test += "b";
If I have eight hours for cutting wood, I spend six sharpening my axe.
Probably you'd want to use the insert member function to insert the word you wish to add to the string once you find where in the string the insert is to take place.
I used to be an adventurer like you... then I took an arrow to the knee.