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 are guid? Why does com need guids?

1022


How can you tell what shell you are running on unix system?

1083


What are advantages of using friend classes?

1020


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

1134


What is command line arguments in C++? What are its uses? Where we have to use this?

1211


What are protected members in c++?

1091


What does flush do c++?

1026


What are the vectors in c++?

1000


What is endianness?

1054


What data structure is fastest, on average, for retrieving data: a) Binary Tree b) Hash Table c) Stack

1040


Is c++ vector a linked list?

964


What is searching?

1076


What do you mean by translation unit?

1050


Refer to a name of class or function that is defined within a namespace?

1068


Which one is better- macro or function?

1145