F
Fletcher Glenn
I've done some web searching and I cannot find a suitable answer to this
question for the following circumstances. Consider:
class Base
{
private:
Otherclass* instance;
public:
Base() { instance = new Otherclass; }
virtual ~Base() { delete instance; }
};
class Derived : public Base
{
private:
Someclass *xxx;
public:
Derived() { xxx = new Someclass; }
virtual ~Derived() {
// The following is incomplete destruction for class Base
// What should be here?
delete xxx;
}
};
Thanks in advance,
question for the following circumstances. Consider:
class Base
{
private:
Otherclass* instance;
public:
Base() { instance = new Otherclass; }
virtual ~Base() { delete instance; }
};
class Derived : public Base
{
private:
Someclass *xxx;
public:
Derived() { xxx = new Someclass; }
virtual ~Derived() {
// The following is incomplete destruction for class Base
// What should be here?
delete xxx;
}
};
Thanks in advance,