Lets assume we have the following code.
class b
{
public:
virtual foo();
};
class c : public b
{
public:
void foo();
};
int main()
{
C c;
B* b = &c;
b->foo(); //I understand that it call foo() in class C
}
What I want to understand is with the help of vtable ?
I understand the following things
1) b will have a vtable with pointer to function foo().
2) when the compiler comes across class c, vtable of b will be inherited in C.
My question
1) will the inherited vtable from b be updated the address of c::foo() ?. I have this doubt because c::foo() is not a virtual function. Predominantly what I have read points to vtable having virtual function.