I am new to comp science so your ideas would be helpful a good deal. Personally i thought that it can be achieved using a batch script but wonder if it can be done using C++ as i want the final tool to be an .exe file which perform the above intended operation when executed.
I would suggest a STL List of Strings to hold the information when you have read it from disk, see http://www.cplusplus.com/reference/stl/list/ fro more info on the List Template.
You then simply find the point in the list you want to insert the new line, then write the list back to disk (replacing the original).
For a few files, using Notepad is a lot quicker, but it is an interesting excersise to make a generic tool for this than can handle replacement in multiple files, automaticaly finding the insertion point, etc.
PS: Please delete the duplicate posts in the Windows Programming Forum and General Forum