fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. struct Base {
  5. int i;
  6. };
  7.  
  8. struct Derived : Base {
  9. int j;
  10. virtual ~Derived() {}
  11. };
  12.  
  13. int main()
  14. {
  15. Derived d, *pd = &d;
  16. Base *pb = pd;
  17. cout << pb << " " << pd << endl;
  18. }
  19.  
Success #stdin #stdout 0s 3140KB
stdin
Standard input is empty
stdout
0xbfca6ef8 0xbfca6ef4