fork(11) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. struct A {
  5. int x;
  6. };
  7. struct B {
  8. int y;
  9. };
  10. struct C : public A, B {
  11. };
  12.  
  13. int main() {
  14. C c, *pc = &c;
  15. A *pa = static_cast<A*>(pc);
  16. B *pb = static_cast<B*>(pc);
  17. cout << hex << pa << " " << pb << " " << pc << endl;
  18. return 0;
  19. }
Success #stdin #stdout 0.02s 2724KB
stdin
Standard input is empty
stdout
0xbfffa418 0xbfffa41c 0xbfffa418