protected 成员值得注意的易错点

来源:互联网 发布:医疗大数据平台 编辑:程序博客网 时间:2024/05/20 23:03
#include "stdafx.h"#include <iostream>#include <list>using namespace std;struct A{protected:int num;public:A(){cout<<"AAA"<<endl;}};struct B: A{public:int test(A &a,B &b){int qq=num;qq=b.num;return 1;}};int _tmain(int argc, _TCHAR* argv[]){A a;//a.num=11;B b;//b.num=11;}

原创粉丝点击