What does this mean const int*& var?
<p>I saw someone using this </p>

<pre><code>void methodA(const int*&amp; var);
</code></pre>

<p>in one answer, but couldn't understand what the argument means.</p>

<p>AFAIK:</p>

<ul>
<li><p><code>const int var</code> => const value which can't be changed</p></li>
<li><p><code>const int* var</code> => pointer to int which is const i.e *var can't be changed but var can be changed</p></li>
<li><p><code>const int&amp; var</code> => reference to const int i.e value of var can't be changed</p></li>
</ul>

<p>What does <code>const int*&amp; var</code> mean, and is <code>const int&amp; *var</code> also possible?</p>

<p>Can you please give some example as well, like what can be done and what can't be done with it?</p>

<p>UPDATE :</p>

<p>I am not sure if I am thinking right way, but I began to think reference as alias of the variable that was pass as argument, so
const int * p;
methodA(p) => here we are passing p as const int * but we dont know if this is pass by value or what until we see the definition of method A,</p>

<p>so if methodA is like this
methodA(const int * &amp; p2) ==> here p2 is another name to p, i.e. p and p2 are same from now on
and if methodA(const int* p2) ==> here p2 is passed as value i.e p2 is just local to this method,</p>

<p>please correct me if I am thinking wrong way ? If yes, I might need to study some more about this ? Can you please point some nice references ?</p>

<p>UPDATE 2
If some beginner like me want to know more about this thing, you can use <strong>c++decl /</strong> <strong>cdecl program</strong>, which I just discovered to very useful from <a href="http://stackoverflow.com/questions/859634/c-pointer-to-array-array-of-pointers-disambiguation/859676#859676">here</a></p>

<pre><code>$ c++decl
Type `help' or `?' for help
c++decl&gt; explain const int&amp;* p
declare p as pointer to reference to const int
c++decl&gt; explain const int*&amp; p
declare p as reference to pointer to const int
</code></pre>

<p>But as every one here pointed, first example isnt legal in C++.</p>

<p>Thanks</p>
