difference between (void*) and &
<p>Hi I've been exercising with placement new and using it to create objects.
Consider the following:</p>

<pre><code>class PNewTesting
{
private:
    string words;

public:
    PNewTesting(const string &amp; w = "Placement new testing");
};

PNewTesting::PNewTesting(const string &amp; w)
{
    words = w;
    cout &lt;&lt; words &lt;&lt; " constructed" &lt;&lt; endl;
}


int main()
{
    char * buffer = new char[BUF];

    PNewTesting *p1,*p2;

    p1 = new (buffer)PNewTesting;

    p2 = new PNewTesting("Placing object in heap");

    cout &lt;&lt; "Memory addresses: " &lt;&lt; endl;
    cout &lt;&lt; "buffer: " &lt;&lt; (void *)buffer &lt;&lt; endl;
    cout &lt;&lt; "object placed in buffer: " &lt;&lt; p1 &lt;&lt; endl;
    cout &lt;&lt; "object in heap: " &lt;&lt; p2 &lt;&lt; endl;
}
</code></pre>

<p>The part is is confusing me, is that when I write <code>cout &lt;&lt; "buffer: " &lt;&lt; &amp;buffer &lt;&lt; endl;</code>,
this would give me a different address to when writing <code>cout &lt;&lt; "buffer: " &lt;&lt; (void *)buffer &lt;&lt; endl;</code></p>

<p>The question is what is the difference between <code>&amp;buffer</code> and <code>(void*)buffer</code>, and why does each one of them give me a different address.</p>
