Delete an object from a base class pointer
<p>Imagine I have two class <em>A</em> and <em>B</em> defined like this : </p>

<pre><code>class A {
public:
    virtual void pureVirtual() = 0;
}

class B : public A {
public: 
    virtual void pureVirtual();
}
</code></pre>

<p>I have of course other methods, but that's just for the example. Now, in my cpp code I have this kind of var :</p>

<pre><code>B *myB = new B;
A *myA = myB;
</code></pre>

<p>Is it possible to delete <em>myB</em> object by calling delete on <em>myA</em> like this : <code>delete myA;</code> ? Do I have to do something special to be able to do that ?
Is it okay with OOP ideas and programming style, or a very bad idea ?</p>

<p>Thank you!</p>
