C++ - Insert multiple integers without space separated in one line
<p>I want to insert multiple integer values less than 10.
Example:</p>

<blockquote>
  <p>010011</p>
</blockquote>

<p>Each digit of above integer inputs is treated as single integer value. </p>

<p>I've tried this:</p>

<pre><code>int i=0, j=0;
int arr[10000];
char temp;
do {
   scanf("%d%c", &amp;arr[i], &amp;temp);
   i++;
} while(temp != '\n');

cout&lt;&lt;endl;
for(j=0; j&lt;i; j++) {
  printf("%d ", arr[j]);
}
</code></pre>

<p>But this code won't accept multiple integers in one line if it's initiated with 0(zero). How to solve this? Thank you.</p>