title: more c++ multiple inheritance fun
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/2157104/c-pointer-multi-inheritance-fun">C++ pointer multi-inheritance fun.</a>  </p>
  </blockquote>
  
  
  
  <p>(Follow up on: <a href="https://stackoverflow.com/questions/2157104/c-pointer-multi-inheritance-fun">C++ pointer multi-inheritance fun</a> )</p>
  
  <p>I'm writing some code involving inheritance from a basic ref-counting pointer class; and some intricacies of C++ popped up. I've reduced it as follows:</p>
  
  <p>Suppose I have:</p>
  
  <pre><code>class A{int x, y;};
  class B{int xx, yy;};
  class C: public A, public B {int z;};
  
  C c;
  C* pc = &amp;c;
  B* pb = &amp;c;
  A* pa = &amp;c;
  
  // does pa point to a valid A object?
  // does pb point to a valid B object?
  
  // does pa == pb ?
  </code></pre>
  
  <p>Furthermore, does:</p>
  
  <pre><code>// pc == (C*) pa ?
  // pc == (C*) pb ?
  </code></pre>
  
  <p>Thanks!</p>
  
  <p>Here, "==" means points at the same value.</p>