What would be an appropriate use case for a union in C?

  • Defining a new data type
  • Ensuring data integrity
  • Implementing complex data structures
  • Storing multiple values of different types simultaneously
Unions are often used when you need to store multiple values of different types in the same memory location. Only one of the union's members can hold a value at a given time.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *