File parse code to search and replace a string of text.
Posted on 2015-02-20
I am looking for some C or C++ code that would parse a text file, and replace all occurrences of a string with another string.
So if I have a text file with this text : Mary had a little lamb who's name was Mary Anne.
And I want to replace "Mary" with "Terry", how can I do that in C++. My file might have up to 1000 lines of text in it. The end result would be Terry had a little lamb who's name was Terry Anne.