I have a base class A and a derived class B:
class A
{
public:
virtual f();
};
class B : public A
{
public:
B()
{
p = new char [100];
}
~B()
{
delete [] p;
}
f();
private:
char *p;
};
For any reason the destructor is never called - why? I dont understand this.