?????????protected??private?????????????????????????????????????????????????????????顣???????????????
????#include <iostream> 
????class Person { 
????public: 
????Person(){}; 
????void eat() {std::cout << "eat ";} 
????}; 
????//???м?? 
????class PublicStudent : public Person { 
????public: 
????PublicStudent() {} 
????void study() {std::cout << "study ";} 
????}; 
????//??????? 
????class ProtectedStudent : protected Person { 
????public: 
????ProtectedStudent() {} 
????void study() {std::cout << "study ";} 
????}; 
????//??м?? 
????class PrivateStudent : private Person { 
????public: 
????PrivateStudent() {} 
????void study() {std::cout << "study ";} 
????}; 
????void func_test(Person &p) { 
????p.eat(); 
????} 
????int main() { 
????PublicStudent public_s; 
????ProtectedStudent protected_s; 
????PrivateStudent private_s; 
????func_test(public_s);                    //????????м????????????????????????????? 
????func_test(protected_s);                 //?????????????????????????????????????? 
????func_test(private_s);                   //???????м?????????????????????????????? 
????system("pause"); 
????return 0; 
????} 
????func_test()??????Person?????????????func_test(public_s)??????????PublicStudent???????PublicStudent???м??Person??????PublicStudent??????????Person???????е???г???????????????????????£????м?е????????????????????????ProtectedStudent??PrivateStudent?????????м?У???????????????????Person?????????????????????????????????????????????????????????????????????????????????????protected??к?private??е?????????????????????????