Values
is union type of size int
, which is maximum size of its members.
Considering the size of int
is 4 bytes, then.
+------------+-------------+-------------+-------------+
union Values val = | 1st byte | 2nd byte | 3rd byte | 4th byte |
+------------+-------------+-------------+-------------+
When you store
val.c = 300; //binary 0b100101100
val
will become
+------------+-------------+-------------+-------------+
val = | 0010 1100 | 0000 0001 | | |
+------------+-------------+-------------+-------------+
When you access val.b
you will read the only one byte which contains 0010 1100
.
And decimal equivalent of 0010 1100
is 44
.