Unusall decleartion

Aug 19, 2010 at 11:01am
I have been given somd source code of a program and I am trying to understand how the program works

I have got a stucture defined as

typedef struct
{
BYTE Material: 4;
BYTE : 6;
}TBMU;

A BYTE is just a renaming of a char type. There was a typedef for this eariler in the code.
The member varable decleartion is unusal and I don't understand what it means. Does anyone know what this is doing?
Aug 19, 2010 at 11:19am
yeah, i am surprised.
Aug 19, 2010 at 11:39am
It's a bit field.
Aug 19, 2010 at 11:47am
Sorry, bit feild? I don't think I have come across one before.
Aug 19, 2010 at 12:54pm
Material is 4 bits and the other is 6 bits.
Aug 19, 2010 at 12:57pm
Thanks. I think I understand it now
Topic archived. No new replies allowed.