Question.2
A union has three members of different sizes:
union Payload { uint8_t byte_val; // 1 byte uint32_t word_val; // 4 bytes float float_val; // 4 bytes }; printf("%zu", sizeof(Payload));
What is the output?
Select Answer
9 -- sum of all members
4 -- the size of the largest member; all members share the same memory, so the union is only as large as its biggest member
1 -- the size of the smallest member
8 -- two 4-byte members