This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

The length of struct

Hi,

I define a struct like below:

typedef struct
{
unsigned type :6;
unsigned delete :1;
unsigned mask :1;
}UnitType;

I think the length of this struct is 1 byte, but to my surprise, the length are 2 bytes, in the list file it says:
NAME CLASS MSPACE TYPE OFFSET SIZE
==== ===== ====== ==== ====== ====
UnitType . . . . . . . . . . . . . . . TYPEDEF ----- STRUCT ----- 2
type . . . . . . . . . . . . . . . . MEMBER ----- FIELD 0000H 6.0
delete . . . . . . . . . . . . . . . MEMBER ----- FIELD 0000H 1.6
mask . . . . . . . . . . . . . . . . MEMBER ----- FIELD 0000H 1.7

Is it right? If right, maybe somebody here can explain it to me.

Thanks & Regards.

Elias