【发布时间】:2023-03-06 17:52:01
【问题描述】:
C 中未命名的位域有什么用?
例子:
typedef struct fun {
unsigned int :8;
unsigned int foo1 :1;
unsigned int foo2 :1;
unsigned int foo3 :1;
unsigned int foo4 :1;
unsigned int foo5 :1;
}dig;
线有什么用:
unsigned int :8;
【问题讨论】:
-
在开头保留八位以供将来扩展?你真的要问作者为什么把它放在那里,我们所能做的就是推测。
标签: c bit-fields