title: How can I print "ABCDabcd" with these class constructors?
body: <p>I have the following code:</p>
  <pre class="lang-cpp prettyprint-override"><code>#include &lt;iostream&gt;
  using namespace std;
      
  class A {
  public:
      A() { cout &lt;&lt; &quot;A&quot;; }
      A(const A&amp;) { cout &lt;&lt; &quot;a&quot;; }
  };
  
  class B : public virtual A {
  public:
      B() { cout &lt;&lt; &quot;B&quot;; }
      B(const B&amp;) { cout &lt;&lt; &quot;b&quot;; }
  };
  
  class C : public virtual A {
  public:
      C() { cout &lt;&lt; &quot;C&quot;; }
      C(const C&amp;) { cout &lt;&lt; &quot;c&quot;; }
  };
  
  class D : B, C {
  public:
      D() { cout &lt;&lt; &quot;D&quot;; }
      D(const D&amp;) { cout &lt;&lt; &quot;d&quot;; }
  };
  </code></pre>
  <p>And I want to create a <code>D</code> object and have it print <code>&quot;ABCDabcd&quot;</code>.</p>
  <p>I tried this:</p>
  <pre class="lang-cpp prettyprint-override"><code>int main()
  {
      D d;
      return 0;
  }
  </code></pre>
  <p>But it only prints <code>&quot;ABCD&quot;</code>, and I don't know how to call the rest of the code.</p>
  <p>Any idea?</p>