0

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;)

Community
  • 1
  • 1
Betamoo
  • 14,964
  • 25
  • 75
  • 109
  • 1
    Exact duplicate of [What does 'unsigned temp:3' means](http://stackoverflow.com/questions/2950029/what-does-unsigned-temp3-means). – James McNellis Jun 04 '10 at 21:40

1 Answers1

3

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.

Yann Ramin
  • 32,895
  • 3
  • 59
  • 82