title: Parsing a string with scanf
body: <p>I need to get integers from a string that an user enters into the console.</p>
  
  <p>For exemple:
  I have this string: <code>[1, 2, 3, 4, 5]</code> and I would like to get all of the integers from it. I already tried multiple <code>scanf</code> patterns, such as <code>scanf("%*[^\[]%d,", &amp;a)</code>, but nothing worked. I couldn't find anything relevant on Stack Overflow either.</p>
  
  <p>The main problem is that he can enters between 1 and 50 integers into his string. I have no idea about how to stock only integers (removing ',' and '[' ']' ) into an array.</p>
  
  <p>Some solutions have been found for removing special chars such as [ ] or ,
  But now I still need to remove SPACE between comas and integers...</p>
  
  <p>EDIT : problem solved using fgets. I was using scanf to get my string, but it were stopping to SPACES. </p>
  
  <p>Fond out how to do that with scanf :</p>
  
  <p>while(scanf(" %d",&amp;i))</p>