正在加载图片...
An object of class A would appear in memory as follows Virtual function g Virtual function table for A Table pointer While the object of class b would appear as follows Virtual function Virtual function table for B table pointer B: h Note: The virtual function pointer, once added to the object structure, remains in a fixed location. The f does not obey dynamic binding in C++, since it is not declared virtualAn object of class A would appear in memory as follows: x y Virtual function Table pointer While the object of class B would appear as follows: x y Virtual function table pointer z Note: The virtual function pointer, once added to the object structure, remains in a fixed location. The f does not obey dynamic binding in C++, since it is not declared “virtual”. A::g Virtual function table for A A::g Virtual function table for B B::h
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有