What is a virtual destructor? Explain the use of it?



What is a virtual destructor? Explain the use of it?..

Answer / Neelam

A virtual destructor in C++ ensures that all derived class objects are properly destroyed, even if they were created through pointers to their base class. This is crucial when dealing with polymorphic objects.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C++ General Interview Questions

What are pointers, when declared, intialized to a) NULL b) Newly allocated memory c) Nothing. Its random

1 Answers  


Can a program run without main?

1 Answers  


What are stacks? Give an example where they are useful.

1 Answers  


Is c++ a pure oop language?

1 Answers  


What is c++ hash?

1 Answers  


What does asterisk mean in c++?

1 Answers  


When volatile can be used?

3 Answers   Symphony,


what is software cycle? What is a mission critical system ? What is the important aspect of a real-time system ? Explain the difference between microkernel and macro kernel. Give an example of microkernel.Why paging is used ? Which is the best page replacement algo and Why ? What is software life cycle ? How much time is spent usually in each phases and why Which one do U want to work if selected in Honeywell ? Which are the different types of testing ? What is a distributed system ? Some questions about CSP. Which languages do U know ? What are the differences between Pascal and C. questions from Compiler construction and Lisp. Which are the different computer architecture? What is the requirement in MIMD ? What is the difference between RISC and CISC processors ? Difference between loosely coupled and tightly coupled systems ? What is an open system?

1 Answers   Honeywell,


Define a pdb file.

1 Answers  


Why c++ is the best language?

1 Answers  


What is 'Copy Constructor' and when it is called?

1 Answers  


Can you explicitly call a destructor on a local variable?

1 Answers  


Categories