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

关于位域bit field

C crifan 1885浏览 0评论

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

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

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

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

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
81 queries in 0.155 seconds, using 22.13MB memory