33,311
社区成员
发帖
与我相关
我的任务
分享
A bit-field must be an integral data type. It can be either signed or unsigned . We indicate that a
member is a bit-field by following the member name with a colon and a constant expression
specifying the number of bits:
typedef unsigned int Bit;
class File {
Bit mode: 2;
Bit modified: 1;
Bit prot_owner: 3;
Bit prot_group: 3;
Bit prot_world: 3;
// ...
};