I do have some doubts and i need help from you.
When we call a function which is virtual from a base class pointer to which the address of derived class object, it sees where vpointer, from vpointer it gets the address fo virtual table, manipulate offset and call the right function from vtable.
My question is, when does this vtable get populated ? As the vtable contain the address of all the virtual function belonging to the particular class, does memory is being allocated to the functions of that class before they are being called?
could anyone give a clear description of memory allocation process when virtualism works.