cplusplus:pointers_4
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | Next revisionBoth sides next revision | ||
cplusplus:pointers_4 [2017/03/20 03:38] – [Deallocation] mithat | cplusplus:pointers_4 [2017/03/20 03:40] – [heap vs. stack] mithat | ||
---|---|---|---|
Line 263: | Line 263: | ||
==== heap vs. stack ==== | ==== heap vs. stack ==== | ||
- | Up to now, we may have given the impression that local variables and dynamically allocated storage are both allocated memory from the same amorphous | + | Up to now, we may have given the impression that local variables and dynamically allocated storage are both allocated memory from the same pool of RAM. This is not the case. The **stack** is a pool of memory whose allocation and deallocation is automatically managed. Local variables (and global ones too) are allocated from the stack. The **heap** is a pool of memory whose allocation and deallocation is explicitly managed. Dynamically allocated |
A more detailed discussion of the heap versus the stack, while important, is beyond the scope of the present discussion. But it is important to know that there are two different memory pools that C++ programs draw from. | A more detailed discussion of the heap versus the stack, while important, is beyond the scope of the present discussion. But it is important to know that there are two different memory pools that C++ programs draw from. |
cplusplus/pointers_4.txt · Last modified: 2019/03/31 22:35 by mithat