title: Memory allocation of variables
body: <p>I'm in confusion. Does the allocation of automatic, static and global variables take place at compile time or run time?</p>
  
  <p>The thing I know is that at compile time, the source code is translated to machine language.</p>
  
  <p>When the compiler finds a statement like <code>int a;</code>, it writes the instruction. Do any extra things happen, like memory allocation, at compile time?</p>
  
  <p>What happens when the .exe file will be executed?</p>
  
  <p>Whether computer (OS) or compiler will allocate sufficient memory of holding an integer at runtime or compile time.</p>
  
  <p><strong>Also it is said that the address of a global variable is a compile-time constant. What does it mean?</strong>
  Please help to solve each question, especially the last one.</p>