<P> The primary use of a union is allowing access to a common location by different data types, for example hardware input / output access, bitfield and word sharing, or type punning . Unions can also provide low - level polymorphism . However, there is no checking of types, so it is up to the programmer to be sure that the proper fields are accessed in different contexts . The relevant field of a union variable is typically determined by the state of other variables, possibly in an enclosing struct . </P> <P> One common C programming idiom uses unions to perform what C++ calls a reinterpret_cast, by assigning to one field of a union and reading from another, as is done in code which depends on the raw representation of the values . A practical example is the method of computing square roots using the IEEE representation . This is not, however, a safe use of unions in general . </P> <P> Structure and union specifiers have the same form . (...) The size of a union is sufficient to contain the largest of its members . The value of at most one of the members can be stored in a union object at any time . A pointer to a union object, suitably converted, points to each of its members (or if a member is a bit - field, then to the unit in which it resides), and vice versa . </P> <P> In C++, C11, and as a non-standard extension in many compilers, unions can also be anonymous . Their data members do not need to be referenced, are instead accessed directly . They have some restrictions as opposed to traditional unions: in C11, they must be a member of another structure or union, and in C++, they cannot have methods or access specifiers . </P>

In c only one member of a union can be accessed at a particular time true or false