Recently I am working on windows and I found that lot of data structures are defined as struct
with union
as member variables. Example of this would be
The union in a struct technique is generally used when you want a variant-style structure. It's generally accompanied by a type identifier, which is used to determine which item in the union to check. It's also seen in the opposite way, such as in Xlib on *NIX, where it's a union with structs, with the first member identical between all structs, defining which struct has the data you need.