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 / ognas(shradha-asutosh)

in inheritance if the base class contains a virtual
function equating to zero, it is known also as do-nothing
function & that base class is called as abstract base class
as there are no instances or objects can be created by this
base class. And this pure virtual can be filled with the
codes in successiv derived classes accordin to the user
requirements.
The syntax of the pure virtual function is....

class class_name
{
visibility mode:\\should be protected:
virtual return_type function_name()=0;
}
new class_name : inheritance_type old class_name
{
........ //class body
........
}

Is This Answer Correct ?    69 Yes 19 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain abstraction.

1111


Define a nested class.

1074


What are the restrictions apply to constructors and destructors?

1079


What is the standard template library (stl)?

1775


Difference between pointer to constant and constant pointer to a constant. Give example.

1115


Why do we need pointers?

1001


How do you instruct your compiler to print the contents of the intermediate file showing the effects of the preprocessor?

1143


How delete [] is different from delete?

1007


program explaining feautures of c++

2433


Is c++ still being used?

1027


Mention the purpose of istream class?

1107


When is the destructor called?

1026


Can user-defined object be declared as static data member of another class?

1021


Is main a class in c++?

1000


What is a binary file? List the merits and demerits of the binary file usagein C++.

1300