| Section | Title |
|---|---|
| 1 | Fixed-Size Arrays |
| 2 | Array Literals |
| 3 | Slicing Arrays |
| 4 | Sentinel Arrays |
| 5 | Strings Are Bytes |
| 6 | UTF-8 Handling |
| 7 | Exercises |
Fixed-Size ArraysAn array is a sequence of values of the same type.
Array LiteralsAn array literal creates an array value.
Slicing ArraysA slice is a view into an array.
Sentinel ArraysSome arrays have a special value after the last ordinary element. This value is called a sentinel.
Strings Are BytesA Zig string is a sequence of bytes.
UTF-8 HandlingZig strings are bytes. UTF-8 is one way to interpret those bytes as text.
ExercisesThis section closes the chapter. The exercises are small programs. Write them by hand. Compile them. Change them. Run them again.