title: When does memory gets allocated for a variable in c?
body: <p>When does memory gets allocated for a variable in c? Does it happen during declaration or initialization? Does this differ based on the scope or storage class?</p>
  
  <p>Eg:</p>
  
  <pre><code>int i; &lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt; memory gets allocated here?
  i=10;  &lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt; memory gets allocated here?
  </code></pre>
  
  <p>I think, it gets allocated during declaration itself.Correct me if I am wrong.</p>