if i want to dereference an object(using delete operator) of DERIVED class which is being referenced using a BASE class reference, which destructor would b called automatically??
BASE class destructor or DERIVED class destructor??
You need to make the destructor in the base class as virtual (otherwise the base class destructor will be called directly).
A small, pedantic, correction:
You need to make the destructor in the base class virtual, otherwise the effect is undefined (Most implementations call the base-class destructor without first calling the derived-class destructor, thereby leaving the object's memory in a partially-destroyed state).