CMPT 212
Fall 1997
|
class A { public: int x; protected: int y; private: int z; }; class B1 : public A { ... }; class B2 : protected A { ... }; class B3 : private A { ... }; class C1 : public B1 { ... }; class C2 : public B2 { ... }; class C3 : public B3 { ... };This table shows where the members x, y and z can be accessed:
x | y | z | |
A member functions | yes | yes | yes |
B1 member functions | yes | yes | no |
B2 member functions | yes | yes | no |
B3 member functions | yes | yes | no |
C1 member functions | yes | yes | no |
C2 member functions | yes | yes | no |
C3 member functions | no | no | no |
A users | yes | no | no |
B1 users | yes | no | no |
B2 users | no | no | no |
B3 users | no | no | no |
C1 users | yes | no | no |
C2 users | no | no | no |
C3 users | no | no | no |
Return to lecture notes index |
|
This page is maintained by simpson@cs.sfu.ca. | Last updated on 13 Nov 1997. |