title: string (from substr) conversion to unsigned int
body: <p>I have a string which actually contains a number and a string, separated by <code>,</code>, for instance <code>"12,fooBar"</code>. </p>
  
  <p>I would like to put it into separated variables, i.e. the number into <code>unsigned int myNum</code> and the string into <code>std::string myStr</code>.</p>
  
  <p>I have the following snipped of code:</p>
  
  <pre><code>size_t pos1=value.find(',');
  std::cout &lt;&lt; value.substr(0, pos1) &lt;&lt; " and " 
            &lt;&lt; (value.substr(0, pos1)).c_str() &lt;&lt; std::endl;
  </code></pre>
  
  <p>This yields <code>12 and 1</code>. Anything I missed here? What happend to the <code>2</code> in the second part?</p>
  
  <p><em>Note</em>: I isolated the problem to this snipped of code. I need <code>c_str()</code> to pass it to <code>atoi</code> to get the <code>unsigend int</code>. Here I don't want to print the second part.</p>
  
  <p><em>Update</em>: I actually get the string from levelDB <code>Get</code>. If I put a test string like I put here, it works. </p>