Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- class A
- {
- public:
- A()
- {
- cout<<"A constructor called\n\n";
- }
- };
- class B: virtual public A
- {
- public:
- B()
- {
- cout<<"B constructor called\n\n";
- }
- };
- class C: virtual public A
- {
- public:
- C()
- {
- cout<<"C constructor called\n\n";
- }
- };
- class E: virtual public A
- {
- public:
- E()
- {
- cout<<"E constructor called\n\n";
- }
- };
- class F: virtual public A
- {
- public:
- F()
- {
- cout<<"F constructor called\n\n";
- }
- };
- class G: public E, public F
- {
- public:
- G()
- {
- cout<<"G constructor called\n\n";
- }
- };
- class H
- {
- public:
- H()
- {
- cout<<"H constructor called\n\n";
- }
- };
- class I: virtual public H, virtual public C
- {
- public:
- I()
- {
- cout<<"I constructor called\n\n";
- }
- };
- class J: virtual public H
- {
- public:
- J()
- {
- cout<<"J constructor called\n\n";
- }
- };
- class K: virtual public I, public J
- {
- public:
- K()
- {
- cout<<"K constructor called\n\n";
- }
- };
- class L: virtual public I
- {
- public:
- L()
- {
- cout<<"L constructor called\n\n";
- }
- };
- class D: public B, virtual public C, public G, public L, public K
- {
- public:
- D()
- {
- cout<<"D constructor called\n\n";
- }
- };
- int main()
- {
- D d1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement