regular structs in Zig have an implementation-defined layout in memory - the compiler is allowed to re-order fields, add padding, etc.
if you want control over the memory layout you need either a packed struct or an extern struct [0].
if you want control over the memory layout you need either a packed struct or an extern struct [0].
yes, normal structs would have worked fine - like I said, I was learning Zig in the process, so I was going out of my way to experiment with its unique features.