What is virtual constructor paradigm?

Answer Posted / priyanka kokil

A virtual destructor is one that is declared as virtual in
the base class and is used to ensure that destructors are
called in the proper order. It is to be remembered that
destructors are called in the reverse order of inheritance.
If a base class pointer points to a derived class object
and we some time later use the delete operator to delete
the object, then the derived class destructor is not called.

Is This Answer Correct ?    2 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the best way to take screenshots of a window with c++ in windows?

566


What's the order in which the local objects are destructed?

834


what do you mean by volatile variable?

582


Why do we use setw in c++?

640


What's the hardest coding language?

571






Mention the purpose of istream class?

615


What is a wchar_t in c++?

579


Are c and c++ different?

537


Explain differences between alloc() and free()?

578


What are the main features of c++?

540


Can c++ be faster than c?

597


What relational operators if statements in c++?

640


What is a c++ map?

659


Write about an iterator class?

608


How do you invoke a base member function from a derived class in which you’ve overridden that function?

580