What is virtual constructors/destructors?

Answer Posted / syed abdul gaffur.

CONSTRUCTOR:

Constructors cannot be virtual. Declaring a constructor as a virtual function is a syntax error.

DISTRUCTOR :

If an object (with a non-virtual destructor) is destroyed explicitly by applying the delete operator to a base-class pointer to the object, the base-class destructor function (matching the pointer type) is called on the object

Is This Answer Correct ?    7 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What do you mean by abstraction?

604


Is oop better than procedural?

562


assume the program must insert 4 elements from the key board and then do the following programs.sequential search(search one of the elements),using insertion sort(sort the element) and using selection sort(sort the element).

1662


what are the realtime excercises in C++?

2329


What are the three main types of variables?

596






What does no cap mean?

586


What is oops in simple words?

571


Which is not an object oriented programming language?

530


What is the real life example of polymorphism?

602


What does sksksk mean in text slang?

1514


What is polymorphism and types?

594


Following are the class specifications: class {int a}; class {int b}; Using friend funtion,calculate the max of two objects and display it.

1999


Why interface is used?

547


Write a program to reverse a string using recursive function?

1784


What is inheritance in simple words?

617