
3 Oct
2008
3 Oct
'08
10:56 a.m.
Kasra Nassiri(Math & ComSci) wrote:
Hi,
Well the bug is in the fact the when you allocated: B* b = new X();
You have allocated an int extra, thus when you call: delete b;
You are only destructing what was allocated by B
No. You are invoking undefined behaviour.