Search⌘ K

Bits, Bytes, and Memory

Explore how bits and bytes relate to Rust data types, especially strings. Understand why string literals use references, the difference in memory usage across machines, and how Rust handles memory for string data.

We'll cover the following...

The very first program we wrote, “Hello World!”, included strings. So, it’s a bit weird that we’re claiming to cover strings again. However, we’ve only covered the very basics of strings, as string literals, so far. Now that we know about ownership and references, it’s time to go into more depth.

The type of a number literal is i32. The type of a Boolean literal is ...