title: Multipath Inheritance and
body: <p>In the following code the <code>Multi Path Inheritance</code> was resolved by using <code>Virtual Class</code>
  How did the constructor work?
  A Constructor cannot be inherited or virtual or static.</p>
  
  <pre><code>/*Multi Path Inheritance*/
  
  class A{
  
  public:
      int a;
      A(){
          a=50;
      }
  };
  
  
  class B:virtual public A{
  
  public:
      /*B(){
          a = 40;
      }*/
  
  };
  
  class C:virtual public A{
  
  public:
      /*C(){
          a = 30;
      }*/
  
  };
  
  class E:virtual public A{
  
  public:
      E(){
          a = 40;
      }
  
  };
  
  class D : public B, public C, public E{
  
  public:
      D(){
          cout&lt;&lt;"The value of a is : "&lt;&lt;a&lt;&lt;endl;  
      }
  
  };
  
  int main(int argc, char *argv[]){
  
      D d;
      return 0;
  }
  </code></pre>