fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. struct Base
  5. {
  6. virtual ~Base() = default;
  7. };
  8.  
  9. struct Derived : Base
  10. {
  11. int val;
  12. };
  13.  
  14. int main() {
  15. Base * ptr = new Derived[10];
  16.  
  17. delete [] ptr;
  18.  
  19.  
  20. // your code goes here
  21. return 0;
  22. }
Runtime error #stdin #stdout 0s 15240KB
stdin
Standard input is empty
stdout
Standard output is empty