#include <iostream>
using namespace std;
class base{
public:
int i;
base(){
i=1;
cout<<"Base Constructor";
}
};
class derived: private base{
public:
derived(){
i=2;
cout<<"Derived constructor";
}
};
int main(){
derived c;
return 0;
}
对于上面的代码,即使我使用私有继承,为什么我得到的输出为“Base ConstructorDerived Constructor”?