Find back slash (\) in C++
<p>I have a problem with count number of back slash <code>\</code> in C++, I have this code:</p>

<pre><code>string path = "a\b\c";
int level = 0;
int path_length = path.size();
for(int i = 0; i &lt; path_length; i++){
if(path.at(i) == '\\'){
        level++;
    }
}
cout &lt;&lt; level &lt;&lt; endl;
</code></pre>

<p>However, the level is always 0! Can you explain why? And how to count the number of <code>/</code>?</p>
