Interview Question
Country: United States
1. I think vtables are related to at least classes but not to objects.
2. There is 1 vtable for Base, since there are virtual functions in it.
3. There would be 1 vtable for Derived, if it owns some virtual functions which are not in Base.
There are no vtables but vptrs in these objects. Vptrs are pointing to the same vtable. Vtables live as static datas.
one for BASE class and one for DERIVED class
- Anonymous February 07, 2013