Explore BrainMass

C++ Code to Find and Replace Line by Line in a Text File

I am having a difficult time getting started generating a C++ code for this function.

char *ism_repallfile(const char *szin, const char *sztarget, const char *str, const char *sub)

This is what the code is supposed to do: Takes a text file, szin opens it in line_by_line. For each line, it replaces any occurrences of str with sub, then writes it out to the text file sztarget.

Solution Summary

C++ code is highlighted.