title: Does a reference create a new location in memory, or an alias for an existing cell?
body: <p>I am learning about pointers and references, and my question refers to <a href="http://www.dgp.toronto.edu/~patrick/csc418/wi2004/notes/PointersVsRef.pdf" rel="noreferrer">this</a> explanation, in particular the following section:</p>
  
  <p><img src="https://i.stack.imgur.com/Pkhtn.png" alt=""></p>
  
  <p>This suggests that the declaration <code>int&amp; ri = i</code> creates a new memory cell, which has a value of <code>&amp;i</code> and exists in unknown memory location.</p>
  
  <p>To test this theory, I wrote a simple case, the result which is seen below:</p>
  
  <p><img src="https://i.stack.imgur.com/4ZL68.png" alt="enter image description here"></p>
  
  <p>I am perplexed by the fact that <code>r</code> and <code>i</code> have the same memory address, which seems to contradict the readings. The result suggests that <code>int&amp; ri = i</code> loosely means "create an alias for memory cell <code>i</code> and call it <code>r</code>" such that both refer to exactly the same cell.</p>
  
  <p>Is the document correct, or have I missed something?</p>