Newbie Member
25Apr2009,00:35   #11
UIM star's Avatar
good article complition
Go4Expert Founder
29Apr2009,17:54   #12
shabbir's Avatar
Undoubtedly Winner of Article of the month for March 2009
Newbie Member
18Aug2010,10:46   #13
somshekhar's Avatar
Hi Mridula,
Its a nice article but i want to add on to that ...

When we create the object like

Base* pBase = new Derived;
Now as the pointer is of the base class but the object is created of the derived type then when we call a function

pBase->Function1(); The first and the foremost thing happens is that first four bytes of object is extracted which stores the virtual table address and is set to the vptr and since the object is of the type derived it goes to the derived class v-table and calls the corrosponding function, and if a particular function is not overridden in the derived class then it keeps the reference from which class it has been derived..(most derived class not necessarily the base class, could be the class just above the derived class)....
shabbir like this
Newbie Member
17Oct2010,03:40   #14
kgsfun's Avatar
Quote:
Originally Posted by asadullah.ansari View Post
Nice article....
Excellent article, which makes me to understand about virtual functions and pointers very well. It was always a confusion, now I"m confident to answer the questions shooted by interviewers

thanks a lot
Newbie Member
24Nov2010,12:58   #15
kelvincoper's Avatar
Hi Mridula,

Very Nice article. I have a query here. If I write following code in main() function
Code:
 
D1 *d = new D1;
d->function1();
will it be a late binding call?

Thanks,
Newbie Member
15Jan2011,22:52   #16
adityapandey1207's Avatar
Really nice article...Please can you post one more article on how to VPTR, Vtable handles in case of Virtual base class. and
Plz can u explain what's normalized pointers and difference btwn near,far and huge pointers
Newbie Member
14Jan2013,22:48   #17
stamhaney's Avatar
Hi Mridula,

One question. In the pictorial representation of the vtable, you have shown that D1 and D2 have virtual destructors, whereas both D1 and D2 do not have virtual destructors., the desturctor of only base is virtual