What happens if you try to delete memory using the delete operator more than once? 

  • It gets deleted twice 
  • No effect 
  • Program crashes 
  • Memory gets duplicated
Deleting a memory location more than once leads to undefined behavior, most commonly resulting in program crashes. Always ensure memory is deleted once and pointers are set to nullptr afterwards.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *