title: How is this C++ Reference Initialization Legal?
body: <p>I'm currently reading c++ Primer and in one of the exercises, it shows 2 types of reference initializations, one const and and one not, and in the one const, the reference points to 0.. I thought references could only point to objects!!</p>
  
  <pre><code>   int i = -1, &amp;r = 0;         // illegal, r must refer to an object.
  
     const int i = -1, &amp;r = 0;   // legal.
  </code></pre>
  
  <p>So the first one, int  variable  i is -1.  Then int reference r refers to 0 which is 
                                           invalid,gotcha</p>
  
  <p>Now in the second one, const int i = -1, then const reference r = 0.. How?</p>
  
  <p>I know references can't be const, the const is what the reference is referring to, and the book said that const references can refer to both const and non const objects(of the same type). This still doesn't explain why it can point to 0, which is not an object at all..</p>
  
  <p>I'm not sure how the second statement is valid, someone please explain!</p>