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 is the need of a destructor? Explain with the help of an example.
How is new() different from malloc()?
Explain queue. How it can be implemented?
Is c++ the best programming language?
Can a class be static in c++?
What is #include iomanip?
What is null c++?
What methods can be overridden in java?
Does c++ have string data type?
What do you mean by a template?
What will the line of code below print out and why?
Why is "using namespace std;" considered bad practice?
What is the basic of c++?
What are c++ tokens?
. If employee B is the boss of A and C is the boss of B and D is the boss of C and E is the boss of D. Then write a program using the Database such that if an employee name is Asked to Display it also display his bosses with his name. For eg. If C is displayed it should also display D and E with C?