Re:What Makes the Zig Programming Language Unique?
by tomcam on Wednesday October 05, 2022 @10:25PM
(#33103609)
With respect, Iām not sure that answered the question. Surely in a sudoku game the default layout of structs would be absolutely fine, no?
Re:What Makes the Zig Programming Language Unique?
by evil-olive on Wednesday October 05, 2022 @10:29PM
(#33103634)
ahh, I might have misunderstood the question - I wasn't sure if they were asking about Zig in general or my solver in particular.
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.
if you want control over the memory layout you need either a packed struct or an extern struct [0].
0: https://ziglang.org/documentation/0.9.1/#extern-struct