title: replacing all occurences of % with %% ?, need a function?
body: <p>is there a practical method to replace all occurrences of <code>%</code> with <code>%%</code> in the following string</p>
  
  <pre><code>char * str = "%s %s %s";
  
  printf("%s",str);
  </code></pre>
  
  <p>so the result is:</p>
  
  <pre><code> %%s %%s %%s
  </code></pre>
  
  <p>or must I be using a function which scans each character in the string until it finds <code>%</code>, then replaces it with <code>%%</code> ?</p>