using namespace std;
class A{
public:
A(){
cout<<"Class A"<<endl;
}
A(int x){
cout<<x<<endl;
}
};
class B:public A{
public:
B(){
cout<<"Class B"<<endl;
}
B(int x):A(){
cout<<x<<endl;
}
};
class C:public B{
public:
C(){
cout<<"Class C"<<endl;
}
C(int x){
cout<<x<<endl;
}
};
int main(){
B obj(12);
return 0;
}
No comments:
Post a Comment