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 what are the sizes and ranges of the basic c++ data types?

1129


What is #include cmath?

1050


Explain friend class?

1094


Explain the properties and principles of oop.

975


What's the best free c++ profiler for windows?

1043


What are abstract data types in c++?

945


Can you please explain the difference between static and dynamic binding of functions?

989


Explain selection sorting?

1039


What is the difference between struct and class?

1455


Explain the difference between abstract class and interface in c++?

944


Is java as fast as c++?

1066


What is class definition in c++ ?

1045


What is the main use of c++?

1079


Can you overload the operator+ for short integers?

1000


What is the benefit of learning c++?

943