title: Scanf char in for is weird
body: <pre><code>#include &lt;stdio.h&gt;
  
  int main() {
      for (int i = 0; i &lt; 10; i++) {
          printf(&quot;0&quot;);
          char a[0];
          scanf(&quot;%c&quot;, a);
      }
  }
  </code></pre>
  <p>I write this code and for every char in input, it loops an extra time without scanning again. So bash shows:</p>
  <p>0 [i input '1', then:]<br/>
  0011<br/>
  000111<br/>
  0000</p>
  <p>Then loop terminates. It is like it saves the chars in scanf buffer and removes one by one each loop, rereading them extra. But why?</p>