<分区>
Possible Duplicate:
What does 'unsigned temp:3' means
struct Test
{
unsigned a : 5;
unsigned b : 2;
unsigned c : 1;
unsigned d : 5;
};
Test B;
printf("%u %u %u %u", B.a, B.b, B.c, B.d); // output: 0 0 0 0
static struct Test A = { 1, 2, 3, 4};
谁能解释一下 :
在结构中的用途,printf
只是输出 0
所以我假设这些不是默认值,但是那它们是什么?
还有人可以解释一下为什么 A.a, A.b, A.c, A.d
输出 1, 2, 1, 4
而不是 1, 2, 3, 4