what is virtual destructor

Answer Posted / suresh.k (portblair)

Using virtual destructors, you can destroy objects without
knowing their type - the correct destructor for the object
is invoked using the virtual function mechanism. Note that
destructors can also be declared as pure virtual functions
for abstract classes.

if someone will derive from your class, and if someone will
say "new Derived", where "Derived" is derived from your
class, and if someone will say delete p, where the actual
object's type is "Derived" but the pointer p's type is your
class.

Is This Answer Correct ?    2 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Get me an image implementation program.

1561


What is the purpose of polymorphism?

683


What are the 4 main oop principles?

685


Why do we need polymorphism in c#?

691


write a program that takes input in digits and display the result in words from 1 to 1000

1993






How to call a non virtual function in the derived class by using base class pointer

5281


Why is abstraction used?

612


How does polymorphism work?

637


What exactly is polymorphism?

612


Which language is pure oop?

553


What is the advantage of oop over procedural language?

630


Prepare me a program for the animation of train

2005


What is object and class in oops?

590


What is encapsulation in simple terms?

542


What do you mean by overloading?

586