Sortof.
If b had a value, then a[0], a[1], and c would have values, but they wouldn't be the same number you assigned to b.
Basically, unions are ambiguous types. They can be multiple things but still be small because each member shares the same memory as its other members.
For example, if you did
then it would be pointless because a and b are 1) the same type and 2) sharing the same memory, so they will always be the same value.
So if you did this
Then if you assigned a the value 0x00700000 then b's hex value would be 0x00700000, although the value will be different.
When you use a union, you usually want to include a type enum or a strict set of rules for how it's to be used. If the union being passed to something is ambiguous in its usage, then you'll pretty much need an enum to handle it correctly.
If b had a value, then a[0], a[1], and c would have values, but they wouldn't be the same number you assigned to b.
Basically, unions are ambiguous types. They can be multiple things but still be small because each member shares the same memory as its other members.
For example, if you did
union { int a; int b; } someUnion;
then it would be pointless because a and b are 1) the same type and 2) sharing the same memory, so they will always be the same value.
So if you did this
union { int a; float b; } someUnion;
Then if you assigned a the value 0x00700000 then b's hex value would be 0x00700000, although the value will be different.
When you use a union, you usually want to include a type enum or a strict set of rules for how it's to be used. If the union being passed to something is ambiguous in its usage, then you'll pretty much need an enum to handle it correctly.