In this module we discuss memory, arrays, and pointers!
As a programmer, we will often have to think about the memory on our machines. The reason we have to reason about memory is due to space constraints, but more often for performance for desktop applications. Noaw as a consumer (let's say if you're building your own computer), you probably thin about memory at the hardware level thinking in terms of the computers hard drive that you have to purchase or perhaps making a decision on how much RAM (usually meaning DRAM -- those little green sticks) you want to purchase. These are all very important components for us to know about, though for now I want to focus on memory from a programmers perspective.
One luxury we have from the programmers persective, is that we can start by thinking about our working memory as a long linear area of addresses where we can store data.
TODO: Add figure of a long tape of memory
A mechanism known as virtual memory allows most programmers to simply think of memory as this long tape of addresses the size of our working memory.
Note: Programmers on embedded devices, gaming consoles, or other specific domains may not be able to make the same assumptions about having virtual memory. Virtual memory is an abstraction provided by an operating system and often assisted by hardware.
Pass by value semantics
A pointer is a variable type that stores an address.
When to use pass by pointer versus pass by reference (see slides)