CPSC 259 Chapter 7.1: Memory and local memory
Document Summary
When using variables, we need to take into account the memory that they are associated with. So basically, variables take up spaces in the computer s memory. They are essentially convenient names like number and alpha in the code but every time a variable is used, it takes up some space. This space is not permanently reserved for the variable, as that would mess things up. So a computer allocates memory to a variable. That is the variable is given an area to store its value. A allocated variable does not need to have a particular value in it. It just needs to have an area to store value, a place to call home, no need for furniture. When the need for a variable ceases, then it is deallocated, the system reclaims the memory from the variable and it no longer has a place to call home.