I was studying about creating a object with pointer using dynamic allocation. And i read that when an object is created once and its deleted twice,The heap memory gets corrupted. what does corrupted means? Is it similar to memory leak or is it something else?
int main()
{
//consider my class name is sample
sample *p= new sample;
//some code
delete p;
//some code
delete p;
}
when i delete the p for the first time, the memory pointed by p gets cleared and returns safely to the heap. what happens the next time?