Why is `const int& k = i; ++i; ` possible? : <p>I am supposed to determine whether this function is syntactically correct:</p>

<p><code>int f3(int i, int j) { const int&amp; k=i; ++i; return k; }</code></p>

<p>I have tested it out and it compiles with my main function. </p>

<p>I do not understand why this is so. </p>

<p>Surely by calling the function <code>f3</code> I create copies of the variables <code>i</code>and <code>j</code> in a new memory space and setting <code>const int&amp; k=i</code> I am setting the memory space of the newly created <code>k</code> to the exact the same space of the memory space of the copied <code>i</code>, therefore any change, i.e. the increment <code>++i</code>will result in <code>++k</code> which is not possible given that it was set <code>const</code></p>

<p>Any help is greatly appreciated</p>
