本文介绍了里面结构变量声明声明冒号运算符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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.

这篇关于里面结构变量声明声明冒号运算符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

05-27 16:06
查看更多