可能重复:
这个 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
,我不确定这意味着什么。这会影响为这个特定变量分配的字节数吗?