fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. class A{
  5. int x[250];
  6. };
  7.  
  8. class B{
  9. int y[250];
  10. };
  11.  
  12. class C: public A,B{
  13. int z[250];
  14. };
  15.  
  16. C Z[2];
  17.  
  18. int main() {
  19. // your code goes here
  20. C *p = &Z[0];
  21. C *pp = &Z[1];
  22. cout << (int)p<<" "<<(int)(A*)(p)<<" "<<(int)(B*)(p)<<" "<<(int)pp;
  23. return 0;
  24. }
Success #stdin #stdout 0s 3472KB
stdin
Standard input is empty
stdout
134517248 134517248 134518248 134520248