How do you know that your class needs a virtual destructor?

Answer Posted / melos

If the class will be derived from and it will need a virtual
destructor so that the destructor of the derived class will
be invoked if it referenced using the pointer to the base class.

Is This Answer Correct ?    1 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is oops and c++ same?

580


Which operations are permitted on pointers?

570


What is private public protected in c++?

555


What do you understand by zombie objects in c++?

622


What c++ library is string in?

582






What is the use of namespace std in C++?

624


which of the following is not an secondary constant a) array b) real c) union

1272


What are the differences between new and malloc?

633


What are libraries in c++?

611


What is istream and ostream in c++?

600


How can you quickly find the number of elements stored in a static array?

642


Why are pointers not used in c++?

629


Write a program for Divide a number with 2 and Print the output ( NOTE: Check for divide by zero error).

638


Which sort is best for the set: 1 2 3 5 4 a) Quick Sort b) Bubble Sort c) Merge Sort

664


In int main(int argc, char *argv[]) what is argv[0] a) The first argument passed into the program b) The program name c) You can't define main like that

620