I know there are same question about this topic. But I'm still confused. Please explain how A's class constructor is executing with obj
even I inherit A's class constructor privately.
#include <iostream>
using namespace std;
class A{
public:
A(){
cout << "A" << endl;
}
};
class B:private A{
public:
B(){
cout << "B" << endl;
}
};
int main(){
B obj;
return 0;
}
Output
A
B