64,648
社区成员
发帖
与我相关
我的任务
分享
// 其实写个例子就懂了:
class A
{
public:
A(){}
protected:
void test(){ printf("A:test()\n");}
};
class B: public A
{
public:
void bTest()
{
test();
}
};
void main()
{
B b;
b.bTest();//正确
//b.test();//错误
}