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

Why pure virtual functions are used if they don't have implementation / When does a pure virtual function become useful?

Answer Posted / hrpynux@gmail.com

A pure virtual function makes it so the base class can not be instantiated, and the derived classes are forced to define these functions before they can be instantiated. This helps ensure the derived classes do not forget to redefine functions that the base class was expecting them to.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain dangling pointer.

1084


What is difference between malloc()/free() and new/delete?

1129


How compile and run c++ program in turbo c++?

1132


What is the role of copy constructor in copying of thrown objects?

1018


On throwing an exception by the animal constructor in p = new animalq, can memory leak occur?

1089


Define a nested class. Explain how it can be useful.

1054


Can constructor be private in c++?

989


How do I run c++?

1015


What is vectorial capacity?

1129


What is the difference between public, private, and protected access?

1026


What is using namespace std in c++?

1111


What is the best free c++ compiler for windows?

1068


What do you mean by storage classes?

1520


Can we use pointers in c++?

1020


Can member data be public?

1009