title: Reading input one character at a time
body: <p>For example, given "1912" as input, how do I parse this input and populate an <code>int a[]</code> so that it has <code>a[0]=1</code>, <code>a[1]=9</code> and so on. </p>
  
  <p>If done through a <code>for</code> loop it will take <code>a[0]=1912</code> and not <code>a[0]=1</code>.</p>
  
  <pre><code>for(int i=0;i&lt;n;i++){
      cin&gt;&gt;a[i];
  }
  </code></pre>