title: How to scan 2-dimensional char array in c
body: <p>I want to get string(including white spaces)input save to 2-dimensional array.
  my code is this :</p>
  
  <pre><code>char a[10000][6];
  scanf("%d", &amp;n);
  for (int i = 0;i &lt; n;i++)
  {
      scanf("%[^\n]s", a[i]);
  }
  
  for (int i = 0;i &lt; n;i++)
  {
      printf("%s\n", a[i]);
  }
  </code></pre>
  
  <p>What I got that is wrong output.Please give me any suggestion!</p>