title: How to read a backslash as part of a string in C++
body: <p>I am trying to read a backslash as part of a string, but it is always escaped.</p>
  <p>For example:</p>
  <pre><code>string s = &quot;Bo\nes&quot;
  
  for(int i = 0; i &lt; s.size(); i++) {
      if (s[i] == '\\') cout &lt;&lt; &quot;Found a backslash&quot;;
  }
  </code></pre>
  <p>That does not work.  And across other testing I always get the string reading as &quot;Boes&quot;.  How would I be able to read that backslash such that I can parse the entire string?</p>