title: Replace function in C++
body: <p>I have one string A B C. I need to replace space with underscore(_) in C++. Is there any function like we have in perl or java?</p>
  
  <p>Input: </p>
  
  <pre><code>   char* string =  "A B C" 
  </code></pre>
  
  <p>Output</p>
  
  <pre><code>    A_B_C
  </code></pre>