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
How do I run c++?
Why do we need templates?
Can you help me with this one? Make a program that when a user inputed a Product Name, it will display its price, and when the user inputed the quantity of the inputed product, it will show its total price. The output must be like this: Product Name: Price: Quantity: Total Price: ..this is the list of products to be inputed: Cellphone - 1500 Washing Machine - 5200 Television - 6000 Refrigirator - 8000 Oven - 2000 Computer - 11000 thanks..:D
Can we use this pointer inside static member function?
What is the identity function in c++? How is it useful?
What is the difference between mutex and binary semaphore?
Is eclipse good for c++?
What is a c++ class?
What is data hiding c++?
What is virtual destructor ans explain its use?
Why c++ is faster than java?
What is the use of volatile variable?
What is private, public and protected inheritance?
What is the last index number in an array of 100 characters a) 100 b) 99 c) 101
Can non graphic characters be used and processed in C++?