Why would you make a destructor virtual?

Answer Posted / sunny bogawat

we make destructure as virtual because when we derived a
class from base class then destructor called from derived
to base so for this happening correctly we haveto make base
class destructor as avirtual.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain the virtual inheritance in c++.

603


What is switch case in c++ syntax?

630


Explain the static member function.

711


What operator is used to access a struct through a pointer a) >> b) -> c) *

598


Do the parentheses after the type name make a difference with new?

655






Explain the purpose of the keyword volatile.

640


How do you find out if a linked-list has an end? (I.e. The list is not a cycle)

607


Explain how functions are classified in C++ ?

811


Evaluate the following expression as C++ would do :8 * 9 + 2 * 5 a) 82 b) 79 c) 370 d) list

618


What is the correct syntax for inheritance a) class aclass : public superclass b) class aclass inherit superclass c) class aclass <-superclass

693


Which is best ide for c++?

572


How does java differ from c and c++?

546


What is the difference between the parameter to a template and the parameter to a function?

643


What is the use of turbo c++?

557


What is a multiset c++?

555