开发者

C++ struct definition [duplicate]

This question already has answers here: 开发者_如何学Python Closed 12 years ago.

Possible Duplicate:

What does ‘unsigned temp:3’ means

I just found this code in a book (was used in an example)

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

What is the meaning of this structure definition? (the A:1;)


Those are C bitfields. In compliant compilers, the combination of A B and C do not occupy more than one int. A, B, and C occupy one bit each in the integer.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜