Possible Duplicate:
Bitfield manipulation in C
I saw some c codes, typedef a struct, like
typedef struct
{
unsigned a:1;
unsigned b:1;
unsigned c:1;
unsigned rest:13;
} Interface_type;
what dose unsigned a:1;
mean?
Possible Duplicate:
Bitfield manipulation in C
I saw some c codes, typedef a struct, like
typedef struct
{
unsigned a:1;
unsigned b:1;
unsigned c:1;
unsigned rest:13;
} Interface_type;
what dose unsigned a:1;
mean?
unsigned a:1
Defines a bit field that only occupies 1 bit.
See here: http://en.wikipedia.org/wiki/Bit_field
Signed variables, such as signed integers will allow you to represent numbers both in the positive and negative ranges.
Unsigned variables, such as unsigned integers, will only allow you to represent numbers in the positive