title: C++ parse, fetch a variable number of integers from a string
body: <p>I have a set of strings which looks like <br>
  <em>"4 7 14 0 2 blablabla"</em> <br>
  <em>"3 8 1 40 blablablablabla"</em> <br>
  <em>...</em> <br></p>
  
  <p>The first number N correspond to how many numbers will follow.<br>
  Basically, the format of a string is N+1 numbers, separated with a space, followed by an unknown number of irrelevant characters at the end that I don't need.<br></p>
  
  <p>How can I get all the numbers in variables or a dynamic structure given that I don't know the number N in advance ?<br></p>
  
  <p>In other words, I'd like something like:</p>
  
  <pre><code>sscanf(s, "%d %d %d %d",&amp;n,&amp;x,&amp;y,&amp;z);
  </code></pre>
  
  <p>which would work no matter how many numbers in the string.</p>