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

suppose A is a base class and B is the derved class. Both
have a method foo which is defined as a virtual method in
the base class. You have a pointer of classs B and you
typecast it to A. Now when you call pointer->foo, which
method gets called?

The next part of the question is, how does the compiler
know which method to call?

Answer Posted / nm

The answer is that B->foo gets calle, and why ? I found a
good explanation of that here:

http://en.wikipedia.org/wiki/Virtual_table

Is This Answer Correct ?    3 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is coupling in oops?

1069


write knight tour problem which is present in datastructure

2599


i got a backdoor offer in process global,Bangalore..Can i work with it?

2791


What is abstraction and encapsulation?

944


What is an example of genetic polymorphism?

1119


Can you inherit a private class?

1061


what's the basic's in dot net

2123


Write a program to sort the number with different sorts in one program ??

2325


Explain the advantages of inheritance.

1079


What does oop mean in snapchat?

1153


What does <> mean pseudocode?

1116


What is this pointer in oop?

1003


design a c++ class for the chess board,provide a c++ class definition for such class(only class definition is required)

6622


Which type does string inherit from?

1063


What is multilevel inheritance in oop?

972