What is dangling pointer? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 4

What is dangling pointer?

28th Jul 2016, 3:20 PM
krishna desai
2 Answers
+ 9
It's a pointer that points to an invalid address that was formerly valid. Text book example is a pointer to a variable on the stack that gets cleaned up.
28th Jul 2016, 3:59 PM
Stefan
Stefan - avatar
+ 1
when a pointer is declared but it doesn't point to any memory location then we should initialise it with null if this doesn't made then there exists a dangling pointer problem as it is not able to point any memory location.
2nd Dec 2016, 12:03 PM
Dharm Vashisth
Dharm Vashisth - avatar