A
Al_C
OK, my K&R is about 10 years old now, I'm tring to understand the following:
typedef struct
{
union
{
OPTICAL_REPORT optical;
UINT8 battery_level;
} shared;
UINT8 combi;
} AL_Struct;
I;m ok with the union piece, it's either one or the other in the same memory
space.
But I don't understand the shared term.
If I did a sizeof, would it be 16 bits?
Thanks,
Al
From what I gather the OPTICAL_REPORT data type is a 16 bit ints.
So is the shared term saying I have either the battery_level or the combi
available to me?
typedef struct
{
union
{
OPTICAL_REPORT optical;
UINT8 battery_level;
} shared;
UINT8 combi;
} AL_Struct;
I;m ok with the union piece, it's either one or the other in the same memory
space.
But I don't understand the shared term.
If I did a sizeof, would it be 16 bits?
Thanks,
Al
From what I gather the OPTICAL_REPORT data type is a 16 bit ints.
So is the shared term saying I have either the battery_level or the combi
available to me?