A pointer pointing to a memory location that has been deleted (or freed) is called dangling pointer. There are three different ways where Pointer acts as dangling pointer.
- De-allocation of memory
- Function Call
- Variable goes out of scope
—— from https://www.geeksforgeeks.org/dangling-void-null-wild-pointers/