title: c: scanf reading integers
body: <p>This scanf statement will read in numbers from input like <code>10ss</code> as 10 - how do I rewrite it to ignore an int that's followed by other characters? If <code>10ss</code> is read, it should ignore it and stop the for loop.</p>
  
  <pre><code>for (int i = 0; scanf("%d", &amp;val)==1; i++)
  </code></pre>