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

How the V-Table mechanism works?

Answer Posted / deepa balamurugan

If the both Base and the Derived class having the same
function then the Base class funtion should be declared as
virtual function. Then the C++ determines which function to
be called at the runtime based on the type of the object
pointed to by the Base pointer rather than the type of the
pointer.
As soon as the compiler reads the keyword virtual ,it will
create the vtable contains the address of the virtual
function inside that class and as soon as vtable is
created ,vptr is initialized to the proper vtable.

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why we use #include conio h in c++?

992


What is namespace & why it is used in c++?

1037


When should I use unitbuf flag?

968


Can create new c++ operators?

963


What are the types of pointer?

1037


Can I learn c++ as my first language?

1052


Why c++ is called oop?

1054


What is copy constructor? Can we make copy constructor private in c++?

1025


What's the "software peter principleā€?

1089


What is the role of C++ shorthand's?

1224


Why is c++ not purely object oriented?

962


What is flag in computer?

983


Explain differences between new() and delete()?

1049


Explain about vectors in c ++?

969


Define the operators that can be used with a pointer.

993