References in C++
<p>I have just started C++ and have come across references and have not understood completely.</p>

<p>References , as i read  is an alternative name for an object.Why use that instead of directly accessing the object as any operation on references is directly reflected on the object ...?</p>

<ol>
<li>Why and when are they used ?</li>
<li>Is ist like a constant pointer that is referenced each time it is used ... ?</li>
</ol>

<p>And , it says </p>

<pre><code> double&amp; dr = 1;  ----  says it is an error (some lavalue needed) 
 const double&amp; cdr = 1;  ---- says it is ok. 
</code></pre>

<p>i dont understand it properly..So please explain why it is so ...</p>

<p>Thank You...:) </p>
