title: Replace a line in text file
body: <p>I want to replace a line of text in a file, but I don't know a functions to do this.</p>
  <p><strong>I have this:</strong></p>
  <pre><code>ofstream outfile(&quot;text.txt&quot;);
  ifstream infile(&quot;text.txt&quot;);
  
  infile &gt;&gt; replace with other text;
  </code></pre>
  <p>Any answers for this?</p>
  <p>I miss to say, for add text in Some line in the file...</p>
  <p><strong>Example</strong></p>
  <pre><code>infile.add(text, line); 
  </code></pre>
  <p>Does C++ have functions for this?</p>