A
Avalon1178
Hello,
Are default destructors virtual?
In other words, say I have "class A" and "class B : public A", and I
have the code below:
A * a = new A;
B * b = new B;
a = b;
delete a;
Neither A or B have destructors defined (thus creating a default
destructor for each), when "delete a" is called, will it call b's
destructor first then a's destructor, or will it just call a's
destructor?
Are default destructors virtual?
In other words, say I have "class A" and "class B : public A", and I
have the code below:
A * a = new A;
B * b = new B;
a = b;
delete a;
Neither A or B have destructors defined (thus creating a default
destructor for each), when "delete a" is called, will it call b's
destructor first then a's destructor, or will it just call a's
destructor?