WHAT IS A UNION
A union, is a collection of variables of different types, just like a structure. However, with unions, you can only store information in one field at any one time.
You can picture a union as like a chunk of memory that is used to store variables of different types. Once a new value is assigned to a field, the existing data is wiped over with the new data.
A union can also be viewed as a variable type that can contain many different variables (like a...
Unions in C : A less used but a powerful feature of C
A union, is a collection of variables of different types, just like a structure. However, with unions, you can only store information in one field at any one time.
You can picture a union as like a chunk of memory that is used to store variables of different types. Once a new value is assigned to a field, the existing data is wiped over with the new data.
A union can also be viewed as a variable type that can contain many different variables (like a...
Unions in C : A less used but a powerful feature of C