Professional Documents
Culture Documents
PROGRAMMING IN C++
4. Multiple 5. Hybrid
Visibility of Inherited members
Multiple Inheritance
• A class can inherit the attributes of two or more classes
•Constructors
•Destructors
•Non-member functions
•Assignment operators
•Virtual methods
}
Example:
Constructor for derived class D derived from Class A and Class
B
D(int a1, int a2, float b1, float b2, int d1): A(a1, a2), B(b1,b2)
{
d = d1;
}
cout << "point p: " << p << "\ncircle c: " << c << endl;
pptr = &c;
cout << "\nCircle c via pptr is: " << *pptr << endl;