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

Define a constructor - what it is and how it might be called (2 methods)?

1118


What is the difference between the compiler and the preprocessor?

1098


What is public, protected, private in c++?

1137


What is prototype for that c string function?

1116


Which function should be used to free the memory allocated by calloc()?

1016


Define a conversion constructor?

1064


Explain about Garbage Collector?

1108


what is data encapsulation in C++?

1053


Does c++ have arraylist?

1002


Implement stack operations with pointers with appropriate exception checks.

964


Explain virtual destructor?

1167


Carry out conversion of one object of user-defined type to another?

1040


What does it mean to declare a member variable as static?

1044


How can we check whether the contents of two structure variables are same or not?

1059


Why is main an int?

981