title: string replace in file using C
body: <p>I haven't yet implemented this, I'm still in the thinking stage, but I have to go through a file and replace a certain string with another string. For example,</p>
  
  <pre><code>&lt;img src="/images/logo.gif" ...
  </code></pre>
  
  <p>should become</p>
  
  <pre><code>&lt;img src="/proxy/www.example.com/images/logo.gif" ...
  </code></pre>
  
  <p>Any advice on how I can approach this? Perhaps there exist some "string replace" C functions that would do this for me that I don't know about...?</p>
  
  <p>Right now, if I had to write this function myself, I would give it as parameters the file, string to replace, replacement string. Then I would manually go through the file and look for an occurrence of the string and recreate it. This, however, seems very inefficient. Are there better ways to do this?</p>
  
  <p>Thanks,
  Hristo</p>