A
Ann O'Nymous
I want to create a union, where one element is a (32 bit) unsigned int,
and the second element is an array of 8 things, each 4 bits wide. What
is the syntax for doing so?
union name {
unsigned int foo;
unsigned :4 bar[8];
} xxx;
....
xxx.foo = 0;
xxx.bar[1] = 1;
printf ("%d\n",xxx.foo); --> produces "16"
(little endian machine)
I also want to create an array of 32 booleans each 1 bit wide.
unsigned:1 flags[32];
and the second element is an array of 8 things, each 4 bits wide. What
is the syntax for doing so?
union name {
unsigned int foo;
unsigned :4 bar[8];
} xxx;
....
xxx.foo = 0;
xxx.bar[1] = 1;
printf ("%d\n",xxx.foo); --> produces "16"
(little endian machine)
I also want to create an array of 32 booleans each 1 bit wide.
unsigned:1 flags[32];