最新消息:20210816 当前crifan.com域名已被污染,为防止失联,请关注(页面右下角的)公众号

关于位域bit field

C crifan 2161浏览

具体如何写,网上找到一个例子,如下:

/*
*   The bit field structures for representing time
*/
typedef struct
{
     unsigned int Hour :   5;
     unsigned int Minute :6;
} TimeType;

就是在普通定义元素之后,加个冒号和位数而已。

转载请注明:在路上 » 关于位域bit field

82 queries in 0.195 seconds, using 19.15MB memory