Keeping track of objects and references
<p>If we comment out the emphasized line below we get 777 in the console.
Otherwise we get some garbage like (-534532345).
My environment is Microsoft Visual Studio 2012 Pro.</p>

<pre><code>class C
{
public:
    C () { x = 777; }
    void ou() {cout &lt;&lt; x;}
protected:
    int x;
};

class A
{
public:
    A(C &amp; rrc) : rc(rrc) {};
    void koo () {rc.ou();}
protected:
    C &amp; rc;
};

int _tmain(int argc, _TCHAR* argv[])
{
    C c;
    C * pc = new C;
    A a(*pc);
    delete pc; // &lt;&lt;&lt;&lt; this line
    a.koo();

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

<p>Can anyone help me figure out why I am seeing this behavior?</p>
