cplusplus:pointers_4_slides
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
cplusplus:pointers_4_slides [2021/10/24 02:56] – [Memory management of regular variables] mithat | cplusplus:pointers_4_slides [2021/10/24 02:57] – [Memory leaks] mithat | ||
---|---|---|---|
Line 139: | Line 139: | ||
void ninetynine() | void ninetynine() | ||
{ | { | ||
- | int *localPtr = nullptr; | + | int *localPtr = nullptr; |
localPtr = new int; // but not dynamically allocated storage | localPtr = new int; // but not dynamically allocated storage | ||
Line 184: | Line 184: | ||
* Memory leaks, no matter how small, are bad programming practice. | * Memory leaks, no matter how small, are bad programming practice. | ||
* Can be fixed by the proper use of **deallocation**: | * Can be fixed by the proper use of **deallocation**: | ||
- | * Deallocation of dynamically allocated storage does not happen automatically. | + | |
* You must explicitly (i.e., manually) deallocate the memory. | * You must explicitly (i.e., manually) deallocate the memory. | ||
cplusplus/pointers_4_slides.txt · Last modified: 2021/10/24 03:02 by mithat