From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Jody Hagins" To: Subject: What does the vtable look like? Date: Wed, 30 Jun 1999 15:43:00 -0000 Message-ID: <004c01beb414$728d96e0$29f782cc@lewstherin.atdesk.com> X-SW-Source: 1999-06n/msg00381.html Message-ID: <19990630154300.zxQGF7sOW8O-eixXUsYFxpTMdO1MwrzrSh4VcCP0UuY@z> With cfront, I can get the virtual function table like so... struct Virtual_Function_Table_Entry { short d; short i; int (*f)(); }; The virtual table pointer stored in each object points to an array of Virtual_Function_Table_Entry structures. Then I can run through all the virtual functions like so... class VBase { public: virtual ~VBase(); }; VBase:: ~VBase() { } void print_virtual_functions(VBase * p) { Virtual_Function_Table_Entry * vtbl = *((Virtual_Function_Table_Entry**)p); for (int i = 0; vtbl[i].f; ++i) { cout << "virtual function " << i << " is " << vtbl[i].f << endl; } } For egcs, what does the virtual table pointer point to? Is it a table of pointers, structures, a linked list of pointers? What is it? Thanks!