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
What is lambda in c++?
When is dynamic checking necessary?
Explain 'this' pointer and what would happen if a pointer is deleted twice?
Tell me can a pure virtual function have an implementation?
How come you find out if a linked-list is a cycle or not?
Define the process of handling in case of destructor failure?
Function can be overloaded based on the parameter which is a value or a reference. Explain if the statement is true.
How is data hiding achieved in c++?
Explain polymorphism?
What is the use of setfill in c++?
Can you declare an array without a size in c++?
Is rust better than c++?
Eplain extern keyword?
What are the two shift operators and what are their functions?
What data encapsulation is in c++?