What is a virtual destructor?

Answers were Sorted based on User's Feedback



What is a virtual destructor?..

Answer / munendra kumar

The simple answer is that a virtual destructor is one that is declared with the virtual attribute.

The behavior of a virtual destructor is what is important. If you destroy an object through a pointer or reference to a base class, and the base-class destructor is not virtual, the derived-class destructors are not executed, and the destruction might not be complete.

Is This Answer Correct ?    0 Yes 0 No

What is a virtual destructor?..

Answer / nakul kumar

The simple answer is that a virtual destructor is one that is declared with the virtual attribute.

The behavior of a virtual destructor is what is important. If you destroy an object through a baller or reference to a base class, and the base-class destructor is not virtual, the derived-class destructors are not executed, and the destruction might not be complete.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C++ General Interview Questions

How are pointers type-cast?

0 Answers   iNautix,


What is class syntax c++?

0 Answers  


Explain about profiling?

1 Answers  


Define vptr.

0 Answers  


What is optimization in c++? when using volatile.optimization is not possible..what does this mean?

1 Answers  






Comment on local and global scope of a variable.

0 Answers  


What is pointer -to-members in C++? Give their syntax?

0 Answers   Honeywell, Zomato,


What is the difference between #import and #include in c++?

0 Answers  


Is c++ the most powerful language?

0 Answers  


What is the difference between a copy constructor and an overloaded assignment operator?

4 Answers   Belzabar, Citrix, Microsoft, Wipro,


What is a far pointer? where we use it?

0 Answers  


What is the best ide for c++?

0 Answers  


Categories