title: Why a reference declaration influences my pointer?
body: <p>Case 1</p>
  <pre><code>#include &lt;iostream&gt;
  using namespace std;
  int main() {
      int n = 1;
      // int &amp; r = n;
      int * p;
      cout &lt;&lt; &amp;n &lt;&lt; endl;
      cout &lt;&lt; p &lt;&lt; endl;
      return 0;
  }
  </code></pre>
  <p>Output 1</p>
  <pre><code>0x7fffffffdc94
  0
  </code></pre>
  <p>Case 2</p>
  <pre><code>#include &lt;iostream&gt;
  using namespace std;
  int main() {
      int n = 1;
      int &amp; r = n;
      int * p;
      cout &lt;&lt; &amp;n &lt;&lt; endl;
      cout &lt;&lt; p &lt;&lt; endl;
      return 0;
  }
  </code></pre>
  <p>Output 2</p>
  <pre><code>0x7fffffffdc8c
  0x7fffffffdd90
  </code></pre>
  <p>In Output 2, the pointer p just pointed to the address followed int n. Shouldn't an unintialized pointer point to some random places?
  Why adding a reference declaration influences the address of p pointed to?</p>