C++/Reference - How to assign a NULL to a reference
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/657964/is-using-null-references-ok">Is using NULL references OK?</a>  </p>
</blockquote>



<p>C++/References</p>

<p>Q1.</p>

<p>it is said that we can never assign null to a reference, but how can be done that. I know t will give error but I'm interested how that statement will look like. I tried following statements ut none of these gave error. </p>

<pre><code>int *p, *q = NULL;
int &amp;k = p, &amp;j = *q, &amp;z = 0; &amp;x = 0x00, &amp;y = NULL;
</code></pre>

<p>but in none of the cases it gave an error. some value was printed and was initializing reference using temporary variable.</p>
