Site icon Learn Web Development & Programming, Artificial Intelligence, WordPress, Shopify Articles

What is dangling pointer in c?

Dangling pointer:

If any pointer is pointing the memory address of any variable but after some variable has deleted from that memory location while pointer is still pointing such memory location. Such pointer is known as dangling pointer and this problem is known as dangling pointer problem.

A pointer initially holding valid address, but later the held address is released or freed. Then such a pointer is called as dangling pointer

Exit mobile version