Difference Between Struct And Union. Total size of the union is equivalent to the size of the largest data member. Let char arr [2] will be 2 bytes info, so the compiler will use 4 bytes of info to store 2.

Users may access or recover any member at a time. A structure is defined by the struct statement, whereas a union is defined by the union statement. Changing the value of one data member will affect/change the value of other data members as well.