January 2019
Beginner to intermediate
554 pages
13h 31m
English
These pointers are already familiar to you from the borrowing section. References are like pointers in C, but they are checked for correctness. They can never be null and always point to some data owned by any variable. The data they point to can either be on the stack or on the heap, or the data segment of the binary. They are created using the & or the &mut operator. These operators, when prefixed on a type T, create a reference type that is denoted by &T for immutable references and &mut T for mutable references. Let's recap on these again:
Read now
Unlock full access