Explain what happens when a pointer is deleted twice - C++

Explain what happens when a pointer is deleted twice.

A pointer if not nullified and deleted twice, leads to a trap. If set to null, it wont have much affect if deleted twice.

Explain what happens when a pointer is deleted twice.

If you delete a pointer and set it to NULL, it it possibly cannot have an adverse effect. It is safe. However, if a pointer is deleted an not nullified, then it can cause a trap.
What is a smart pointer?
What is a smart pointer? - Smart pointers are objects which store pointers to dynamically allocated (heap) objects..
Difference between an inspector and a mutator - C++
Difference between an inspector and a mutator - The get() functions are usually refered to as inspectors as that just retrieve the data values from the source....
What is pointer? - C++
What is pointer? - A pointer is a variable that holds a memory address....
Post your comment