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 does getch() do according to the ANSI C++ standard a) Reads in a character b) Checks the keyboard buffer c) Nothing in particular (Its not defined there)
What is the difference between a reference and a pointer?
What is stl containers in c++?
Are strings mutable in c++?
Explain the problem with overriding functions
Show the declaration for a static function pointer.
Does improper inheritance have a potential to wreck a project?
How do you master coding?
Can you Mention some Application of C/C++?
Can a list of string be stored within a two dimensional array?
Write a corrected statement in c++ so that the statement will work properly. if (4 < x < 11) y=2*x;
What is the average salary of a c++ programmer?
How can you create a virtual copy constructor?
What is the function to call to turn an ascii string into a long?
Ask to write virtual base class code?