I have a struct
that looks something like the following:
typedef unsigned __int16 UINT16;
typedef unsigned __int64 UINT64;
struct Example {
struct {
UINT64 var1 : 5;
UINT64 var2 : 2;
UINT64 var3 : 29;
UINT64 var4 : 23;
UINT64 : 5;
};
struct {
UINT16 var5 : 4;
UINT16 var6 : 2;
UINT16 : 10;
};
};
I was expecting sizeof(struct Example)
to return 10
, but it returned 16
. I have no clue why this is happening, and I would appreciate any input on the matter.