title: Read string and various integers in same line in C
body: <p>I have a string called <code>buffer</code> which has the following data stored:<br>
  <em>Rb [7, 0] 64</em>  </p>
  
  <p>Using <code>sscanf()</code>, I'd like to do the following:</p>
  
  <ul>
  <li>Read <code>Rb</code> and store it in a <code>string</code> called <code>name</code></li>
  <li>Read <code>7</code> and store it in an <code>int</code> variable called <code>posx</code>  </li>
  <li>Read <code>0</code> and store it in an <code>int</code> variable called <code>posy</code>  </li>
  <li>Read <code>64</code> and store it in a <code>int</code> variable called <code>battery_level</code>  </li>
  </ul>
  
  <p>I tried the following, but it doesn't work:</p>
  
  <pre><code>sscanf(buffer, "%s[^\ ] [%d,%d] %d", name, &amp;posx, &amp;posy, &amp;battery_level);
  </code></pre>