C++ struct definition [duplicate]
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.
精彩评论