* Memory used inside functions is dealt with automatically
* Function memory grows on the `stack`
* User allocated memory grows on the `heap`
* In x86 (architecture we use)
* Stack decreases from the top
* Heap increases from the bottom
| Higher | stack |
| $\big\downarrow$ |
| |
| |
| |
| |
| |
| |
| $\big\uparrow$ |
| Lower | heap |
---
## Example
```C
/*
* Stack Vs Heap example
*/
#include