- Pointers are just addresses. Addresses to locations in memory where variables ‘live’.
- File pointers - used for working with files.
- Pointers provide an alternative way to pass data between functions.
- Anytime memory is being talked about, RAM is memory being referenced not HDD or SDD.
- Different data types take up different sizes in memory VIZ:
- int - 4 bytes
- char - 1 byte
- float - 4 bytes
- double - 8 bytes
- long long - 8 bytes
- Pointers generally are data items whose ‘value’ is a memory address and whose type describe the data located at that memory address.
- Arrays are just pointers – the name of an array, specifically, is a pointer.
- Pointers can be ‘dereferenced’.
- GOOD HABIT: set pointers to
NULL
if on declaration, a meaningful address isn’t set, yet.
- Pointers can be used to access blocks of dynamically allocated memory at runtime.
- Dynamically allocated memory comes from the heap
malloc()
- Hexa-f**king-decimals!
- Locations in memory are hexadecimally identified.