title: Putting numbers separated by a space into an array
body: <p>I want to have a user enter numbers separated by a space and then store each value as an element of an array. Currently I have:</p>
  
  <pre><code>while ((c = getchar()) != '\n')
  {
      if (c != ' ')
          arr[i++] = c - '0'; 
  }
  </code></pre>
  
  <p>but, of course, this stores one digit per element.</p>
  
  <p>If the user was to type:</p>
  
  <pre><code>10 567 92 3
  </code></pre>
  
  <p>I was wanting the value 10 to be stored in <code>arr[0]</code>, and then 567 in <code>arr[1]</code> etc.</p>
  
  <p>Should I be using <code>scanf</code> instead somehow?</p>