fork download
  1. class HeapData
  2. {
  3. public:
  4. HeapData()
  5. {
  6. data = new char[27];
  7. }
  8.  
  9. HeapData(const HeapData &other)
  10. {
  11. data = other.data;
  12. }
  13.  
  14. ~HeapData()
  15. {
  16. delete[] data;
  17. }
  18.  
  19. private:
  20. char *data;
  21. };
  22.  
  23. int main()
  24. {
  25. HeapData hd;
  26.  
  27. HeapData other = hd;
  28. return 0;
  29. }
Runtime error #stdin #stdout #stderr 0s 4492KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
free(): double free detected in tcache 2