title: In C++, what's the use of having a function void foo(int** p)?
body: <p>I have been told by my colleague that <code>void foo(int** p)</code> is used like an out parameter in C#. Can someone precisely explain how?</p>
  
  <p>I get the idea, but there is something that is missing. I know that if we pass the pointer <code>p</code> itself to <code>foo(*p)</code> and the function body does <code>p = new int()</code>, we might have a dangling modifier! But how does <code>foo(**p)</code> prevent something like that from happening?</p>