C ++结构定义

时间:2010-06-04 21:39:34

标签: c++ c typedef struct

  

可能重复:
  What does ‘unsigned temp:3’ means

我刚在书中找到了这个代码(在一个例子中用过)

typedef struct {
unsigned int A:1;
unsigned int B:1;
unsigned int C:1;
} Stage;

这个结构定义是什么意思? (A:1;

1 个答案:

答案 0 :(得分:3)

那些是C bitfields。在兼容编译器中,A B和C的组合不会占用多个int。 A,B和C在整数中占据一位。

相关问题