Inserting strings in middle of a text file using streams
First and foremost, fix your formatting.  A little bit of effort spent on making the code readable will mean that it can be understood (and thus reviewed) faster.  By the way, you are not using the STL.

Now, significant issues in order of when they appear in your code:


Use an std::vector in favour of new[] pretty much always.  In this case, as the content is all text, an std::string may be even better, but causes problems due to you wanting to read directly into it.
As you want to work with the input on a line-by-line basis, I would advise an std::vector&lt;std::string&gt; that you can populate using a std::string line; while (fileSt &gt;&gt; 
line) lines.push_back(line);.  There may be more efficient solutions, but check that you really need them first.
What you're doing with sprintf doesn't make sense.  That could all be replaced with std::string strToFind = "Input" + boost::lexical_cast&lt;std::string&gt;(outPutNumber);.
Notice that if you store the strings as I recommended above, finding a certain line is as simple as lines[nInputLine].
To write everything back, just insert another line into the vector and then write it using a loop or with stream iterators.
No need to explicitly close the files unless you care about the exception that may throw.


And some minor issues:


Your comments are inconsistent, and duplicate information.  You have specified the type everywhere except for in filename, despite the type already being given by the signature.
No need to check for fileSt.good() when checking if its open.
As your function only does anything if the file is opened successfully, return early instead of wrapping the whole thing in a giant if.
Be consistent with qualifying things with std::; do it or don't do it, but don't mix it.  (I would advise explicitly qualifying things above using-declarations (and even more so above using-directives), but all three may be acceptable.)
Same with Hungarian notation: even if you don't agree that the qualifiers don't help with anything, you should at least either use them consistently.