fork(2) download
  1. #include <cstdio>
  2.  
  3. struct Base
  4. {
  5. virtual ~Base() {}
  6. };
  7.  
  8. struct X1 : public virtual Base {};
  9. struct X2 : public virtual Base {};
  10. struct Child : public X1, public X2 {};
  11.  
  12. int main()
  13. {
  14. X1 * p1 = new X1();
  15. delete p1;
  16. Base * p2;
  17. p2 = p1;
  18. printf("p2 = %p\r\n", (void *)p2);
  19. return 0;
  20. }
  21.  
Runtime error #stdin #stdout 0s 4520KB
stdin
Standard input is empty
stdout
Standard output is empty