Abstract
- A variable whose value is Memory Address
Pointee
- The actual data that a pointer points-to inside the Heap Segment
Pointer Dereference
Null Pointer
- Pointer that doesn’t point to any memory location, basically contains a invalid Memory Address
- In C, it is represented by
0
ornullptr
- In Java, it is represented by
null
, Custom Datatype can benull
Void Pointer
- A Pointer without type aka a pre-defined size
- Used when we aren’t sure what the exact size of a variable like the return type of malloc
- We should always try to cast it to a type whenever it is possible
Rust
Rust Box
- A smart Pointer that represents Rust Ownership of values allocated on the Heap Segment
Rust References
- Non-owning pointers that points to Rust Box, thus they do not own the data they point to.
- Powers Rust Borrowing