title: Error in scanf()
body: <p>first of all, I've got a logical error in my code. Well, this is the code</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  int main()
  {
      long i,j,t;
      scanf("%ld",&amp;t);
      long n[t],d[t][t];
      for(i = 0; i &lt; t;i++){
          scanf("%ld",&amp;n[i]);
          for(j = 0; j &lt; n[i] ;j++){
              scanf("%ld",&amp;d[j][i]);
          }
      }
      for(i = 0; i &lt; t;i++){
          for(j = 0; j &lt; n[i] ;j++){
              printf("%ld ",d[j][i]);
          }
          printf("\n");
      }
      return 0;
  }
  </code></pre>
  
  <p>And I input the data</p>
  
  <pre><code>2
  4
  25 20 30 90
  3
  45 50 55
  </code></pre>
  
  <p>And the result is</p>
  
  <pre><code>25 20 30 90
  45 50 55
  </code></pre>
  
  <p>Well, that's what I expected. However, when the input become like this</p>
  
  <pre><code>3
  5
  12 67 89 34 56
  6
  34 56 78 90 12 34
  7
  12 34 89 23 56 78 89
  </code></pre>
  
  <p>The result become like this</p>
  
  <pre><code>12 34 89 23 56 78 89
  12 67 89 34 56 4206692 7 2293472 1982002386 16 3 2293344 2293408 0 2293552 0 0 4
  198585 8918456 1982106837 1982010910 8918456 2293640 0 0 1985286516 2009576437 0
   0 2293664 2009323341 2293740 2147348480 0
  34 56 78 90 12 34 4199405 1982595752 8 12 2293424 2 2 1982356412 2147348480 2293
  608 2147348480 1 -1 297753669 1982010784 1982015505 4199044 0 0 2147348480 21473
  48480 0 0 0 7273647 2009576392 0 0 0 1 0 20 52 0 0 438759246 736 -214797894 1420
   760826203 2272 852421325 3108 944791496 4028 -1322777276 4988 9 1 1 1204 7168 4
   2 152 11832 7 1 40 12316 1682469715 1 140 44 0 0 0 2 0 7209065 5701724 6029427
  
  12 34 89 23 56 78 89
  </code></pre>
  
  <p>Well, the simple question, why the output become like the above?? When I input above 2, the same result will be happened. Any possible answers and links if you don't mind it?? Thanks</p>