mirror of
https://github.com/dholerobin/Lecture_Notes.git
synced 2025-09-13 13:52:12 +00:00
Update Pointers_C++.md
This commit is contained in:
@@ -1011,6 +1011,8 @@ A memory leak happens when your program loses the address of dynamically allocat
|
|||||||
|
|
||||||
**Solution:** Delete(deallocate memory) before anything goes wrong.
|
**Solution:** Delete(deallocate memory) before anything goes wrong.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### Dangling pointer
|
### Dangling pointer
|
||||||
|
|
||||||
A pointer that is pointing to a deallocated memory is called a **dangling pointer**. Dereferencing or again deallocating a dangling pointer will lead to undefined behavior(run-time error).
|
A pointer that is pointing to a deallocated memory is called a **dangling pointer**. Dereferencing or again deallocating a dangling pointer will lead to undefined behavior(run-time error).
|
||||||
|
Reference in New Issue
Block a user