最新消息:20210917 已从crifan.com换到crifan.org

关于位域bit field

C crifan 1424浏览 0评论

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

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

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

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

发表我的评论
取消评论

表情

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

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
91 queries in 0.160 seconds, using 23.36MB memory