when can we use virtual destructor?
Answer Posted / achal ubbott
We should know the proper sequence of calling of
destructors.
1. destructor of derived.
and then
2. destructor of base.
but if base* bptr = new derived();
then
delete bptr;
can behave wrong and violate the sequence. got it?
Is This Answer Correct ? | 15 Yes | 0 No |
Post New Answer View All Answers
What c++ library is string in?
Is java the same as c++?
What are pointers, when declared, intialized to a) NULL b) Newly allocated memory c) Nothing. Its random
What is c++ & why it is used?
Evaluate the following expression as C++ would do :8 * 9 + 2 * 5 a) 82 b) 79 c) 370 d) list
What is difference between rand () and srand ()?
What is a unnitialised pointer?
Differentiate between structure and class in c++.
Does improper inheritance have a potential to wreck a project?
Differences between private, protected and public and give examples.
What can I use instead of namespace std?
How do you show the declaration of a virtual constructor?
Explain object slicing in c++?
How can you link a c program with a c function?
What is difference between array and vector in c++?