The last construct to lay out your data are unions. Unions are used to store different types in the same memory location. This has three main practical reasons:

  1. Naming the same data differently.
    Lets say you want a 3d vector, which you can use both as position and as color. You can use a union to define it as x,y,z and r,g,b.
  2. Storing different data in the same location.
    To do that, you use the union to declare which types you want to store and and enum to store, which type actually got stored.
  3. Accessing the same data in a different way.
    If you are doing low level programming, you sometimes have to deal with the byte order of different platforms. It could then be useful to access types in form of bytes.

Your task is to define the struct box, which holds either an int or an float in the same position and tells you with an enum what it has stored.