+ 1
Dangling pointer points address of freed memory?
Then what way we can use dangling pointer?
2 Respuestas
+ 4
U can assign new address to reuse the same pointer variable, instead of declaring a new pointer variable if you need.
Hope this helps...!!!
+ 2
A good practice I use it to set the dangling pointer to null after I free the memory. You can always set it to a different memory address like Kuri said too.