Answer Posted / priyanka kokil
A virtual destructor is one that is declared as virtual in
the base class and is used to ensure that destructors are
called in the proper order. It is to be remembered that
destructors are called in the reverse order of inheritance.
If a base class pointer points to a derived class object
and we some time later use the delete operator to delete
the object, then the derived class destructor is not called.
| Is This Answer Correct ? | 2 Yes | 2 No |
Post New Answer View All Answers
What is the full form of c++?
What is the c++ code?
What is lambda in c++?
What is command line arguments in C++? What are its uses? Where we have to use this?
I was a c++ code and was asked to find out the bug in that. The bug was that he declared an object locally in a function and tried to return the pointer to that object. Since the object is local to the function, it no more exists after returning from the function. The pointer, therefore, is invalid outside.
Define token in c++.
what you know about c++?
If dog is a friend of boy, is boy a friend of dog?
What is the C-style character string?
What are c++ storage classes?
Write a code/algo to find the frequency of each element in an array?
Define pointers?
Is dev c++ free?
Does std endl flush?
What is the difference between delegation and implemented-in-terms-of?