Delphi-Quellcode:
Type
TMyUnion = Record
case boolean of
false : (Foobar : Word);
true : (Foo,Bar : Char);
end;
Foobar and Foo, Bar have the same physical memory space, i.e. if you modify e.g. Foobar, Foo and Bar will also be modified.
Adapt this idea to your challenge.