0

What is dangling pointer?

7th Aug 2016, 6:20 PM
shanmuga priya
shanmuga priya - avatar
2 Answers
+ 1
Dangling pointers arise during object destruction, when an object that has an incoming reference is deleted or deallocated, without modifying the value of the pointer, so that the pointer still points to the memory location of the deallocated memory.
9th Aug 2016, 2:55 PM
James Flanders
0
when u free some memory by delete action on an object or dynamically allocated data type.....and forget to change the pointer variable to point to null....it becomes dangling pointer as it is still pointing to something which no longer exist and may cause issue when dereferenced
21st Oct 2016, 9:06 PM
PANKAJ KUMAR
PANKAJ KUMAR - avatar