struct One{
int x[6];
short y[12];
} a;
union Two{
int x[6];
short y[12];
} b;
Assume that ints are 32 bits, and that shorts are 16 bits.
a. What is the sizeof(a) and sizeof(b)?
b. if &a = 0x00320000
, what is &a.y
?
c. if &b = 0x00320400
, what is &b.y
?
Could someone please explain how to derive at the size of the union and struct, as well as how to get the values for the addresses. I understand that &a and &b mean the address of a and b respectively. However, i'm not exactly sure how to derive at what &a.y and &b.y will return.