fork(7) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. struct C{int n;};
  5. struct A{int n;};
  6. struct B : A, C{};
  7.  
  8. int main()
  9. {
  10. B b;
  11. B* pb = &b;
  12. cout << static_cast<C*>(pb) << "\n";
  13. cout << reinterpret_cast<C*>(pb);
  14. }
  15.  
  16.  
Success #stdin #stdout 0s 15240KB
stdin
Standard input is empty
stdout
0x7fff1b7f5804
0x7fff1b7f5800