I\'m new to C++ and from what I learned so far when you call delete on a pointer that points to something created on the heap then whatever is pointed by that pointer gets e
The mechanics are that delete simply tells the system that the memory is no longer needed and can be repurposed for use again. There is no other action taken. This is the basis of the use-after-free errors seen in security disclosures. It is contingent on the programmer to not use the memory again.
To that end, RAII is one method to attempt to reduce incidents of this problem.