why constructor cannt be declar virtually?
why destructor cannt be overloaded?
Answer Posted / subhashish sen
Constructor can't be virtual,becoz constructor is an entity
which initializes V-table(V-table contains addrress of all
the virtual functions of class).So if we declare constructor
as virtual the who will intialize V-table for this constructor.
Destructor can not be overloaded simply becoz we cant
provide argument to a destructor and also its going to
release the memory when an object goes out of scope.
Is This Answer Correct ? | 20 Yes | 0 No |
Post New Answer View All Answers
Why is there no multiple inheritance?
Where is pseudocode used?
What are the 4 main oop principles?
What is abstraction and encapsulation?
What is class encapsulation?
What are constructors in oop?
What is inheritance and how many types of inheritance?
What is overloading in oop?
to find out the minimum of two integer number of two different classes using friend function
What is cohesion in oop?
What is inheritance in oop?
How to handle exception in c++, For example in a functions i am assigning memory to some variables and also in next instructions in am dividing one variable also. If this functions generates a error while allocating memory to those variable and also while dividing the variable if i divide by zero then catch block how it will identify that this error has cone from perticular instruction
How Do you Code Composition and Aggregation in C++ ?
Explain virtual inheritance?
Write a c++ program to display pass and fail for three student using static member function