How 'delete' works when I delete a pointer of base class
<pre><code>#include &lt;iostream&gt;

using namespace std;
int *p1;
struct base
{
    base():a(10){}
    int a;
    ~base()
    {
        cout &lt;&lt; "~base()\n";
    }
};

struct derive:public base
{
    derive():b(5){

        p1=&amp;b;
        cout &lt;&lt; p1 &lt;&lt; "\n";

    }
    int b;
    ~derive()
    {
        cout &lt;&lt; "~derive()\n";
    }
};
int main()
{
    base *p = new derive;
    delete(p);
    cout &lt;&lt; *p1;
    return 0;
}
</code></pre>

<p>I think b of derive shoule not be deleted,but what p1 pointed was deleted.
how it works when I delete pointer of a base class that was pointed to an derive class when no dynamic inherit occured?
sorry for my english.</p>
