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


Please Help Members By Posting Answers For Below Questions

What is lambda in c++?

568


When is dynamic checking necessary?

587


Explain 'this' pointer and what would happen if a pointer is deleted twice?

594


Tell me can a pure virtual function have an implementation?

544


How come you find out if a linked-list is a cycle or not?

564






Define the process of handling in case of destructor failure?

564


Function can be overloaded based on the parameter which is a value or a reference. Explain if the statement is true.

641


How is data hiding achieved in c++?

565


Explain polymorphism?

574


What is the use of setfill in c++?

574


Can you declare an array without a size in c++?

563


Is rust better than c++?

590


Eplain extern keyword?

554


What are the two shift operators and what are their functions?

549


What data encapsulation is in c++?

585