title: Why are global variables always initialized to '0', but not local variables?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong> <br/>
    <a href="https://stackoverflow.com/questions/2091499/why-global-and-static-variables-are-initialized-to-their-default-values">Why are global and static variables initialized to their default values?</a></p>
  </blockquote>
  
  
  
  <p>See the code,</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  int a;
  int main(void)
  {
      int i;
      printf("%d %d\n", a, i);
  }
  </code></pre>
  
  <p><strong>Output</strong></p>
  
  <pre><code>0 8683508
  </code></pre>
  
  <p>Here 'a' is initialized with '0', but 'i' is initialized with a 'junk value'. Why?</p>