[an error occurred while processing this directive]
|
typedef struct
{
unsigned int oct1: 4;
unsigned int oct2: 4;
unsigned int oct3: 4;
unsigned int oct4: 4;
} bit_fields;
typedef union
{
bit_fields bits;
short int word;
}x_reg;
void main()
{
x_reg r;
r.word = 0x1234;
printf ("%X%X%X%X\n", r.bits.oct1, r.bits.oct2, r.bits.oct3, r.bits.oct4);
}
E-mail: info@telesys.ru