Help me create more content like this!
https://www.paypal.com/donate/?hosted_button_id=Y6DEFHEEWVBXJ
A bare union can have fields of different types but uses only one area of memory for all of them. Only one field can be active at a time, making use of the allocated memory for the union. In this episode we explore both bare and tagged unions in Zig.
The code: https://codeberg.org/dude_the_builder/zig_master
Relevant Links:
- https://ziglang.org/documentation/master/#union
Thumbnail artwork courtesy of: https://www.deviantart.com/krit26/gallery