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

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)

1048


What is the difference between a reference and a pointer?

1108


What is stl containers in c++?

1049


Are strings mutable in c++?

1135


Explain the problem with overriding functions

1157


Show the declaration for a static function pointer.

1048


Does improper inheritance have a potential to wreck a project?

1140


How do you master coding?

1036


Can you Mention some Application of C/C++?

1075


Can a list of string be stored within a two dimensional array?

998


Write a corrected statement in c++ so that the statement will work properly. if (4 < x < 11) y=2*x;

2015


What is the average salary of a c++ programmer?

1021


How can you create a virtual copy constructor?

1085


What is the function to call to turn an ascii string into a long?

1064


Ask to write virtual base class code?

2752