C dangling pointer
A pointer pointing to a memory location that has been deleted or free is called dangling pointer. There are three different ways when Pointer acts as dangling pointer
Dangling pointer occur at the time of the object destroy or the object is deleted from memory without modify the value of pointer. In this case, the pointer is pointing to the memory, which is de-allocated or destroy. The dangling pointer point to the memory, which contain the code of program or the code of the os(operating system). If we assign the value to this pointer, then it overwrite the value of the program code or os(operating system) instructions,
in these cases, the program show unespected result or even crash. when the memory is re allocated to the other process, Then dereference dangling pointer after pointer will show the segmentation fault