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

What is Pure Virtual Function? Why and when it is used ?

Answer Posted / mahfuzur rahman

Virtual function vs pure virtual function :

Virtual function :-

1. Virtual function have a function body.
2. Overloaded can be done by the virtual funciton.
(Optional)
3. It is define as : virtual int myfunction();


Pure virtual function :-

1. Pure virtual function have no function body.
2. Overloading is must in pure virtual funciton. (Must)
3. It is define as : virtual int myfunction() = 0;
4. A class is "abstract class" when it has at least one
pure virtual function.
5. You cann't create instance of "abstract class", rather
you have to inherit the "abstract class" and overload all
pure virtual function.

Like :- CControlBar class is an "abstract class".

Is This Answer Correct ?    144 Yes 24 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the most common mistake on c++ and oo projects?

927


Is c the same as c++?

954


Is there structure in c++?

972


Is c++ primer good for beginners?

989


What is the need of a destructor? Explain with the help of an example.

957


What is a node class in c++?

1025


Explain stack & heap objects?

993


What is malloc in c++?

971


Is eclipse good for c++?

992


What is operator overloading in c++ example?

1050


What is a breakpoint?

957


Which one between if-else and switch is more efficient?

1012


Differentiate between an inspector and a mutator ?

1156


Do class declarations end with a semicolon?

1031


Write some differences between an external iterator and an internal iterator?

970