title: C++ alternative to sscanf()
body: <p>I have the following function:</p>
  
  <pre><code>static void cmd_test(char *s)
   {
      int d = maxdepth;
      sscanf(s, "%*s%d", &amp;d);
      root_search(d);
    }
  </code></pre>
  
  <p>How can I achieve the same output in a C++ way, rather than using <code>sscanf</code>?</p>