How is a NULL pointer different from a Dangling pointer?
S.no | NULL Pointer | Dangling pointer |
---|---|---|
1. | Indicates the pointer isn't pointing to a valid location | Does not point to a correct place |
2. | Happens when memory pointed by it is deallocated | Occurs when an object is removed or deleted |
BY Best Interview Question ON 07 Feb 2019