fork download
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. struct A {};
  6. struct B : A {};
  7. struct C : A {};
  8. struct D : B, C {};
  9.  
  10. int main() {
  11.  
  12. D * d = new D;
  13.  
  14. B * b = d;
  15. C * c = d;
  16.  
  17. A *a[5];
  18. a[0] = b;
  19. a[1] = c;
  20.  
  21. cout << (a[0] == a[1]) << endl;
  22. }
  23.  
Success #stdin #stdout 0.02s 2812KB
stdin
Standard input is empty
stdout
0