What are virtual constructors/destructors?



What are virtual constructors/destructors?..

Answer / Tasleem Khan

Virtual constructors and destructors in C++ allow derived classes to be instantiated and destroyed polymorphically. A virtual constructor is a constructor that can be overridden by the derived class, while a virtual destructor ensures that the destructor for the base class is always called when an object of the derived class is destroyed.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C++ General Interview Questions

Explain pass by value and pass by reference.

1 Answers  


reading material is provided 3 books for c++ if u need more do let me know thnx i hve lots of material do let me know if u want it

2 Answers  


Explain the virtual inheritance in c++.

1 Answers  


What is an explicit constructor?

1 Answers  


Why c++ does not have finally?

1 Answers  


What is c++ coding?

1 Answers  


how many rounds and wt type of questios ask in the written test for first round 2. tech. round 3. and futher rounds

0 Answers   Thought Works,


What is encapsulation in C++? Give an example.

1 Answers   HAL, Honeywell, Zomato,


Write a program to calculate the following i want a c++program for this condition 1+4+9+16+….+100 Like this (1^2+2^2) Hint use function pow(a,b)

4 Answers   HTC, TCS,


What's the hardest coding language?

1 Answers  


What is null pointer and void pointer and what is their use?

1 Answers  


Is multimap sorted c++?

1 Answers  


Categories