title: How does scanf store value?
body: <p>I'm new to C. Given the following code,</p>
  <pre><code>int main(void)
  {
   int a;
   scanf(&quot;%d&quot;,&amp;a);
   scanf(&quot;\n&quot;); // consume trailing newline
  }
  </code></pre>
  <p>As I understand it, the first declaration statement tells the compiler to allocate memory for an integer type variable with an identifier 'a' initialized to 0(as 'a==0'). Scanf needs a valid memory address to store the user input(say 5) so &amp;a being the memory address of 'a' is where the user input is stored as 'a==5'. Is this the case or 'a' is stored as a variable name for the memory address and the contents of the address are simply 5?</p>