title: Strange values on array initialization
body: <p>I'm new to programming in C and i found something i don't understand:</p>
  
  <p>When initializing an array without given values, i thought all elements would be zero. I wrote this few lines of code...</p>
  
  <pre><code>int main()                    
  {     
      int obj[10][4];
  
      for (int a = 0; a &lt; 10; a++)
      {
          print("%d\t%d\t%d\t%d\n", obj[a][0], obj[a][1], obj[a][2], obj[a][3]);
      }            
  }
  </code></pre>
  
  <p>...and was pretty confused by its output:</p>
  
  <pre><code>0       0       0       0
  0       0       0       0
  0       0       0       0
  0       0       0       0
  0       0       0       0
  0       0       0       0
  0       0       0       0
  0       0       0       7661
  7960    2697    2260    7960
  1551630361      -2130960380     146780176       -2130960380
  </code></pre>
  
  <p>I don't understand why some of the values are zero and some are not. I was even more confused that this numbers change when i add more code. For example, i changed the previous example and added another <code>print()</code>...</p>
  
  <pre><code>int main()                    
  {     
      int obj[10][4];
  
      print("start\tstop\tcenter\tdist\n\n");
  
      for (int a = 0; a &lt; 10; a++)
      {
          print("%d\t%d\t%d\t%d\n", obj[a][0], obj[a][1], obj[a][2], obj[a][3]);
      }            
  }
  </code></pre>
  
  <p>...getting this:</p>
  
  <pre><code>start   stop    center  dist
  
  0       0       0       0
  0       0       0       0
  0       0       0       0
  0       0       0       0
  0       0       0       0
  0       0       0       0
  0       0       0       0
  0       0       0       7673
  7972    2709    2272    7972
  1551630361      -2130960380     146780176       -2130960380
  </code></pre>
  
  <p>Using a bigger array, this numbers are not only found at its end. The first few values are always zero, but then "something" happens.</p>
  
  <p>I've found a solution <a href="https://stackoverflow.com/questions/5636070/zero-an-array-in-c-code/5636096#5636096" title="Zero an array in C code">here at SO</a>, using <code>memset()</code>, that works for me, but... what's going on here?</p>
  
  <p>Could someone explain this, using words a C-newbie would understand?</p>