title: Matrix of Char in C - Using Scanf or getchar
body: <p>i'm having a litle trouble with input info on a matrix</p>
  
  <p>i want to build a simple wordsearch game. The user tells the dimension of the matrix to the wordsearch and inputs the characters and i want to print it just to see if everything is okey with the info.</p>
  
  <p>This is my code:</p>
  
  <pre><code>void main (){
  int nl, nc, i,j;
  
  scanf ("%d %d", &amp;nl,&amp;nc); //Input number of lines and collums of the matrix
  
  char matrix [nl] [nc];
  
  for (i=0;i&lt;nl;i++)
      for (j=0;j&lt;nc;j++)
              scanf("%c",&amp;matrix[i][j]);   //Input matrix
  
  printf("This is your matrix:\n");
  for (i = 0; i &lt; nl; i++)
      for (j = 0; j &lt; nc; j++)
         printf("%c", matrix [i][j]);
  }
  </code></pre>
  
  <p>If i input something like</p>
  
  <pre><code>2 3
  ABC
  DEF
  </code></pre>
  
  <p>The output should be:</p>
  
  <pre><code>This is your Matrix:
  ABC
  DEF
  </code></pre>
  
  <p>But my output when i print is something like</p>
  
  <pre><code>This is your Matrix:
  
  ABC
  D
  </code></pre>
  
  <p>It first gives a "\n" then prints but not complete.</p>
  
  <p>What am i doing wrong? Please take in consideration that i should only be using functions like scanf and getchar to build the matrix.</p>