Go4Expert

Go4Expert (http://www.go4expert.com/)
-   C (http://www.go4expert.com/forums/c/)
-   -   dangling pointers (http://www.go4expert.com/forums/dangling-pointers-t1584/)

prem_may10 10Oct2006 12:23

dangling pointers
 
Hi,
Can any one say about the dangling pointer with example

Thanks
yasodhar premchand

shabbir 10Oct2006 13:28

Re: dangling pointers
 
Dangling pointers in programming are pointers which do not point to a valid object.

As an example you allocate a memory using a pointer and deleted it or deallocated using some other pointer and not modifying the value of the first pointer, so now the pointer still points to the memory location of the deallocated memory.

Now if you request the system for reallocation, the previously freed memory may be allocated to another process, and the previous pointer become the dangling pointer.


All times are GMT +5.5. The time now is 22:21.