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 are virtual functions?

Answers were Sorted based on User's Feedback



What are virtual functions?..

Answer / qapoo

A function is declared virtual in base class when u are
having same functions in both base and derived classes and
you want to access both the functions with same function
call and its done using base class pointer.
e.g
class base
{
public:
void show(){cout<<"hi"};
};
class derived:pubic base
{
public:
void show(){cout<<"bye";}
};
int main()
{
base *ptr;
base b;
derived d;
ptr=&b;
ptr->show();//base class fn is called
ptr=&d;
ptr->show();//derived class fn is called
return 0;
}

Is This Answer Correct ?    7 Yes 3 No

What are virtual functions?..

Answer / nikhil kapoor

The function which supports run time polymorphysm is called
virtual function...

Is This Answer Correct ?    3 Yes 2 No

Post New Answer

More OOPS Interview Questions

What is overloading in oop?

0 Answers  


What is overloading and its types?

0 Answers  


function overridind means and simple program

2 Answers  


ambiguity regulation of multiple inheritance with example.

1 Answers  


what is overloading

3 Answers   MindCracker,


what is the diffrence between c# and c++

5 Answers  


Can abstract class have normal methods?

0 Answers  


what is virtual function?

3 Answers  


Program to print 0 to 9 in cross order

3 Answers  


What is polymorphism what is it for and how is it used?

0 Answers  


What is a superclass in oop?

0 Answers  


Can an interface inherit a class?

0 Answers  


Categories