summaryrefslogtreecommitdiff
path: root/exercises/003_assignment.zig
diff options
context:
space:
mode:
authorJustus Klausecker <justus@klausecker.de>2026-03-12 22:26:04 +0100
committerJustus Klausecker <justus@klausecker.de>2026-03-13 11:21:03 +0100
commit16a794fbeef0c1d98069dc825e55af38945b5165 (patch)
treeb1d2c108a0fcb0c88c4f388d44aa9bb769bb12bc /exercises/003_assignment.zig
parent973ec410977b5fd15cf25b4385a7f5b6250ad1c6 (diff)
111/112: Add exercises for packed structs/unions
The first exercise introduces the `packed` keyword as an alternative for bitwise operations. Its main goals are establishing a solid understanding of field order and conveying the fact that packed containers are basically integers. It introduces the concept of container layouts and briefly explains the default `auto` layout before introducing the `packed` layout (but doesn't touch `extern` at all). The exercise also presents a real-world use case for packed containers, namely LZ4 frame descriptors. Furthermore it covers equality comparisons between packed containers. The second exercise talks about switch statements with packed containers and goes into some more detail on packed unions.
Diffstat (limited to 'exercises/003_assignment.zig')
0 files changed, 0 insertions, 0 deletions