fork download
  1. #include <iostream>
  2.  
  3. struct char_with_dtor {
  4. ~char_with_dtor() {
  5. std::cout << "destroyed " << (int)c << '\n';
  6. }
  7. char c;
  8. };
  9.  
  10. int main() {
  11. auto* p = new char_with_dtor[1];
  12. delete p;
  13. }
Runtime error #stdin #stdout 0s 3984KB
stdin
Standard input is empty
stdout
destroyed 0