How to construct virtual constructor
Answer Posted / shakti singh khinchi
Virtual constructors are not used in any case in c++, bcz
the construction order in c++ should always remains from
base to derived , no one can changed their construction
order, so no need to declare constructor as virtual. But if
anyone wants to make it virtual then it is possible to make
a constructor virtual but it is against the OOPs.
| Is This Answer Correct ? | 12 Yes | 2 No |
Post New Answer View All Answers
When the constructor of a base class calls a virtual function, why doesn't the override function of the derived class gets called?
what does the following statement mean? int (*a)[4]
What is a container class? What are the types of container classes in c++?
How do I get good at c++ programming?
What is a breakpoint?
What is a constant? Explain with an example.
Refer to a name of class or function that is defined within a namespace?
What is c++ map?
What is the v-ptr?
Do we have to use initialization list in spite of the assignment in constructors?
How much maximum can you allocate in a single call to malloc()?
What is the basic structure of a c++ program?
What happens when the extern "c" char func (char*,waste) executes?
What is the use of string in c++?
Explain the differences between list x; & list x();.