title: How to print raw std::string/c-style character string in c++
body: <pre><code>string str = "hello/nblabla/nblabla";
  cout &lt;&lt; str &lt;&lt; endl;
  </code></pre>
  
  <p>how do I make output of this program be:
  hello/nblabla/nblabla if I can't use // and generally don't know what string contains. I would like to do the same with c-style char strings as well, and I need to print /0 if it appears in the middle of a c-style string.</p>
  
  <p>I have code something like:</p>
  
  <pre><code>fin &gt;&gt; str;
  stuff_to_do(str);
  cout &lt;&lt; str &lt;&lt; endl;
  </code></pre>
  
  <p>where fin is a std::ifstream to a file containing data like: 123/nb/t/0/1/"...
  I can't reformat this file.</p>