码迷,mamicode.com
首页 > 其他好文 > 详细

位结构占位

时间:2016-08-30 01:52:54      阅读:218      评论:0      收藏:0      [点我收藏+]

标签:

union V{
    struct X{
        unsigned char s1:2;
        unsigned char s2:3;
        unsigned char s3:3;
    }x;
    unsigned char c;
}v;

对于结构体X中表示s1占用字节的0-1,s2占用字节的2-4,s3占用字节的5-7位

位结构占位

标签:

原文地址:http://www.cnblogs.com/yingl/p/5820294.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!