可能是重复问题:
这段C++代码是什么意思?
我正在尝试使用JNA将一个C结构映射到Java中。我遇到了一些我从未见过的东西。
struct
的定义如下:
struct op
{
unsigned op_type:9; //---> what does this mean?
unsigned op_opt:1;
unsigned op_latefree:1;
unsigned op_latefreed:1;
unsigned op_attached:1;
unsigned op_spare:3;
U8 op_flags;
U8 op_private;
};
您可以看到一些变量的定义方式如unsigned op_attached:1
,我不确定这意味着什么。这会影响为此特定变量分配的字节数吗?