开发者

Colon operator in a variable declaration statement inside struct [duplicate]

This question already开发者_如何转开发 has answers here: Closed 11 years ago.

Possible Duplicate:

What does 'unsigned temp:3' means

struct sample{
    int x    :2;
    char y   :4;
};

What does the colon operator do in the above code?


It is used to specify bit fields. The size of the field is given in bits. The layout is compiler-specific.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜