Im trying to learn directx, and the book Im using has a structure that looks like this:
typedef struct VECTOR2D_TYP
}; // end struct
}; // end union
Now I have a vague idea of what a union does. It allows different variables to share the same address space. The problem is I dont know what is going on with the code above. I'm guessing the float array, and the structure share the same space. How would you access the two float variables (x,y) in that structure though, and what is the reasoning behind the union?