Difference between a Structure and a Union

With a union, you’re only supposed to use one of the elements, because they’re all stored at the same spot. This makes it useful when you want to store something that could be one of several types. A struct, on the other hand, has a separate memory location for each of its elements and they … Read more