What is union (C union type)?
A C type whose members all start at the same address and overlap. It is declared as in union { uint32_t w; uint8_t b[4]; } u; and its size is that of the largest member (rounded up to a multiple of the alignment). Only one member holds a meaningful value at a time; unions are used to view the same memory as different types, and to save memory when data takes one of several forms. Writing u.w and reading u.b[0] gives a result that depends on endianness.
Japanese name: 共用体
union (C union type) appears in 1 practice question across 1 topic, including C Programming Basics.
Field: C Programming Basics