Question: Standard C++ provides a pointer-to-member mechanism for classes: Pointers to members are also permitted for subroutine members (methods), including virtual methods. How would you implement
Standard C++ provides a “pointer-to-member” mechanism for classes:
Pointers to members are also permitted for subroutine members (methods), including virtual methods. How would you implement pointers to virtual methods in the presence of C++-style multiple inheritance?
class C { public: int a; int b; } c; int C::*pm // pm points to member a of an (arbitrary)C object &C::a; C* P &c; %3D 3; // assign 3 into c.a p->*pm %3D
Step by Step Solution
3.43 Rating (150 Votes )
There are 3 Steps involved in it
In C pointers to virtual methods are implemented using a mechanism called the virtual function table ... View full answer
Get step-by-step solutions from verified subject matter experts
