How vtable and vptr works in c++

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Vinay Kumar A S
    New Member
    • Jun 2010
    • 1

    #1

    How vtable and vptr works in c++

    More to the point, they may not have a type which can be
    expressed in C or C++. All you can really say is that the vptr points to some class specific meta information (called the vtable or vtbl) and that this meta information includes all the information necessary for virtual function calls, in fact, than just pointers to
    functions. (The names, and the idea that the vtbl is just a table of pointers to functions, come from the earliest versions of CFront: before multiple inheritance the vtbl was just a table of pointers to functions, and CFront used C as its intermediate language, and in this generated C, the names were __vptr and __vtbl__classna me, or something like that.)
Working...