title: Confused with the char array when scanf
body: <p>I am confused with one tiny program.</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  #define LEN 10
  
  int main()
  {
      char str1[LEN] = "\0";
      char str2[LEN] = "\0";
  
      scanf("%s", str1);
      scanf("%s", str2);
  
      printf("%s\n", str1);
      printf("%s\n", str2);
  
      return 0;
  }
  </code></pre>
  
  <p>If my input are:</p>
  
  <blockquote>
    <p>mangobatao<br>
    mangobatao123456</p>
  </blockquote>
  
  <p>Why should the output be:</p>
  
  <blockquote>
    <p>123456<br>
    mangobatao123456</p>
  </blockquote>
  
  <p>And not:</p>
  
  <blockquote>
    <p>mangobatao<br>
    mangobatao123456</p>
  </blockquote>
  
  <p>How has the <code>char</code> array has been allocated in the memory?</p>