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
Differentiate between a constructor and a method in C++.
What does #define mean in c++?
What are literals in C++?
What c++ is used for?
what is upcasting in C++?
How many ways can a variable be initialized into in C++?
what are Operators and explain with an example?
What is c++ try block?
Explain shallow copy?
Is c++ an integer?
What does namespace mean in c++?
When should overload new operator on a global basis or a class basis?
What is the difference between object-oriented programming and procedural programming?
Why is c++ still used?
How can I learn dev c++ programming?