C++ error on f(void*&) call
<p>Can you please explain the error from following code please:</p>

<pre><code>void foo(void*&amp; param)
{
    param = new char[10];
}

void main()
{
    int* p;
    foo(p);
}

error C2664: 'foo' : cannot convert parameter 1 from 'int *' to 'void *&amp;'
</code></pre>

<p>How may I call a function with any pointer type and change that pointer inside the function(not the value at that address, the address itself). I don't want to use templates or double pointers.</p>
