开发者

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

开发者 https://www.devze.com 2023-04-03 23:38 出处:网络
This question already开发者_如何转开发 has answers here: Closed 11 years ago. Possible 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

精彩评论

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