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 does std mean in c++?

785


What is the best it certification?

803


Can I learn c++ without knowing c?

778


Is c++ map a hash table?

756


How can you quickly find the number of elements stored in a static array?

821






Inline parameters : What does the compiler do with the parameters of inline function, that can be evaluated in runtime ?

2190


In which situation the program terminates before reaching the breakpoint set by the user at the beginning of the mainq method?

804


What is jump statement in C++?

777


Why is c++ so fast?

717


How would you implement a substr() function that extracts a sub string from a given string?

752


Can we define a constructor as virtual in c++?

791


How do you establish an is-a relationship?

807


What is a binary file? List the merits and demerits of the binary file usagein C++.

928


Explain about Virtual Function in C++?

762


What is vector string in c++?

774