title: c++ how to remove filename from path string
body: <p>I have</p>
  
  <pre><code>const char *pathname = "..\somepath\somemorepath\somefile.ext";
  </code></pre>
  
  <p>how to transform that into </p>
  
  <pre><code>"..\somepath\somemorepath"
  </code></pre>
  
  <p>?</p>