Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

How do I run c++?

996


Why do we need templates?

947


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

3600


Can we use this pointer inside static member function?

1019


What is the identity function in c++? How is it useful?

992


What is the difference between mutex and binary semaphore?

1112


Is eclipse good for c++?

988


What is a c++ class?

1042


What is data hiding c++?

993


What is virtual destructor ans explain its use?

1071


Why c++ is faster than java?

1006


What is the use of volatile variable?

1029


What is private, public and protected inheritance?

1032


What is the last index number in an array of 100 characters a) 100 b) 99 c) 101

1090


Can non graphic characters be used and processed in C++?

1132