What is the meaning of "*&" in C++
<p>I was looking at manual of ACE framework and came across this declaration</p>

<pre><code>int ACE_Stream&lt;&gt;::get   (ACE_Message_Block *&amp;   mb, ACE_Time_Value * timeout = 0)
</code></pre>

<p>I'm not able to understand what <code>*&amp;</code> stands for. I know * is for pointer and &amp; is reference. Can any one explain what is the meaning of this declaration.</p>

<p>Thanks in advance </p>

<p>So as @NPE said *&amp; makes changes to pointer propagate back. But to understand I just wrote down some code sharing it so that it can help others understand this correctly</p>

<pre><code>#include &lt;iostream&gt;

using namespace std;

class DoSomething
{
public:
  int n;
  DoSomething(int i){
    n = i;
  }
  virtual ~DoSomething();
};

DoSomething::~DoSomething()
{

}

int dosomething(DoSomething * a)
{
  cout &lt;&lt; "Got value from caller: (in dosomething) = " &lt;&lt; a &lt;&lt; endl;
  a = new DoSomething(25);

  return 0;
}

int dosomethingElse(DoSomething *&amp; a)
{
  cout &lt;&lt; "Got value from caller: (in dosomethingElse) = " &lt;&lt; a &lt;&lt; endl;
  a = new DoSomething(15);
  return 0;
}

int main(int argc, char *argv[])
{
  DoSomething *d = new DoSomething(10);

  cout &lt;&lt; "Pointer to DoSomething: " &lt;&lt; d &lt;&lt; endl;

  dosomething(d);
  cout &lt;&lt; "After dosomething value of d: " &lt;&lt; d &lt;&lt; endl &lt;&lt; endl;

  dosomethingElse(d);
  cout &lt;&lt; "After dosomethingElse value of d: " &lt;&lt; d &lt;&lt; endl &lt;&lt; endl;  

  delete d;
  return 0;
}
</code></pre>

<p>So as @NPE said here is out put of this</p>

<pre><code>Pointer to DoSomething: 0x955f008
Got value from caller: (in dosomething) = 0x955f008
After dosomething value of d: 0x955f008

Got value from caller: (in dosomethingElse) = 0x955f008
After dosomethingElse value of d: 0x955f028
</code></pre>

<p>So indeed if I create a new instance inside function it will propagate only if I use <code>*&amp;</code> and not just <code>*</code></p>

<p>Thank you to every one for the answers.</p>
