fork(2) download
  1. struct A {
  2. int *p;
  3. A(unsigned n) : p(new int[n]) {}
  4. ~A() { delete [] p; }
  5. };
  6.  
  7. struct B : A
  8. {
  9. B() : A(4) {}
  10. };
  11.  
  12. int main()
  13. {
  14. A *a = new B();
  15. delete a;
  16.  
  17. return 0;
  18. }
Success #stdin #stdout 0s 4172KB
stdin
Standard input is empty
stdout
Standard output is empty