1.

When delete operator is used ___________________ (If object has a destructor)(a) Object destructor is called after deallocation(b) Object destructor is called before deallocation(c) Object destructor is not used(d) Object destructor can be called anytime during destructionThis question was posed to me in semester exam.This key question is from Delete Operator topic in division Memory Allocation & Scope of Variable of Object Oriented Programming

Answer»

Right choice is (b) Object destructor is called before deallocation

Best explanation: The destructor is called before the MEMORY is DEALLOCATED for any object. The destructor call initiates the DESTRUCTION process and the deallocation of memory takes place.



Discussion

No Comment Found

Related InterviewSolutions