C++ do references occupy memory
<p>I have read that reference is just an alias to a variable existing in the symbol table. Consider the following code</p>

<pre><code>int main()
{
    int y = 6;
    int &amp;z = y;
    int k = 43;
    test(2,y,5,78);
    cout &lt;&lt; &amp;y &lt;&lt; "\n";
    cout &lt;&lt; &amp;z &lt;&lt; "\n";
    cout &lt;&lt; &amp;k &lt;&lt; "\n";
}

void test(int a,int &amp; x, int g, int h)
{
    cout &lt;&lt; &amp;a &lt;&lt; "\n";
    cout &lt;&lt; &amp;x &lt;&lt; "\n";
    cout &lt;&lt; &amp;g &lt;&lt; "\n";
    cout &lt;&lt; &amp;h &lt;&lt; "\n";
}
</code></pre>

<p>For the output I get </p>

<pre><code>0039F740
0039F848
0039F748
0039F74C
0039F848
0039F848
0039F830
</code></pre>

<p>If reference does not occupy memory in the stack, why is the memory being offset. Eg. In the function test, local variable a is at 0039F740 but g is at 0039F748. Shouldn't g be at 0039F744?</p>

<p>Could someone please explain it in depth?</p>