#include
using namespace std;
class A1 {
int i;
public:
A1() { cout << “in A1::A1()
“; };A1(int k) : i(k){ cout << “in A1::A1(int)
“; }}; class A : virtual public A1 {public:A() {cout<<“in A::A()
“;};A(int k) : A1(k){ cout << “in A::A(int)
“;}};class B : public A {public:B(){cout<<“in B::B()
“;};B(int i) : A(i) { cout << “in B::B(int)
“; }};class C : public A {public:C(){ cout << “in C::C()
“; };C(int i) : A(i) { cout << “in C::C(int)
“; }};class D : public B, C{public:D() { cout << “in D::D()
“; }D(int i) : A1(i), B(i), C(i) { cout << “in D::D(int)
“; }};int main(){D d1(2);D d2;int i; cin >> i;
return 0;
}
Reviews
There are no reviews yet.