Unions are collection of different datatype grouped together under a single variable name for convienient handling . union syntax : datatype memberl ; datatype member2; union book int pages; char bookname[10] ; char author[20] ; float price; 4.
Read moreWhat are structures and unions explain with examples?
A structure contains an ordered group of data objects . Unlike the elements of an array, the data objects within a structure can have varied data types. Each data object in a structure is a member or field. A union is an object similar to a structure except that all of its members start at the same location in memory.
Read moreWhat is union structure?
What is Union. Union is a user-defined data type, just like a structure . Union combines objects of different types and sizes together. The union variable allocates the memory space equal to the space to hold the largest variable of union. It allows varying types of objects to share the same location.
Read more