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...

Explain the need for "Virtual Destructor"?

Answer Posted / lylez00

If A is a base class, and from that, B is derived, and a
dynamically allocated object of type B is deleted via a
pointer of type A, then B's destructor will not be invoked
unless A's destructor is virtual.

A *a = new B();
delete a; // won't invoke B's destructor unless A's
destructor is virtual

Is This Answer Correct ?    12 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What jobs can you get with a c++ certification?

1056


What does floor mean in c++?

1064


Briefly describe a B+ tree. What is bulk loading in it?

1341


What are the benefits of operator overloading?

1216


What is setf in c++?

1086


How do you import payscale data from non SAP to SAP?is it through LSMW or any other way is there?

3649


What is a volatile variable in c++?

1466


What is the difference between function overloading and operator overloading?

1112


What is the difference between the functions memmove() and memcpy()?

1121


What are the four partitions in which c++ compiler divides the ram?

1236


What are the uses of static class data?

1187


what is VOID?

1065


What do c++ programmers do?

1056


What is data types c++?

1018


What is the full form of c++?

1348