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:
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?
Transcribed Image Text:
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
This problem has been solved!
Do you need an answer to a question different from the above? Ask your question!
- Tutor Answer
In C pointers to virtual methods are implemented using a mechanism called the virtual function table …View the full answer

Related Book For
Question Details
Chapter #
10
Section: Exercises
Problem: 27
Posted Date: November 26, 2020 01:36:38
Students also viewed these Computer science questions