Why do C++ bit fields require me to specify a type?

前端 未结 0 524
伪装坚强ぢ
伪装坚强ぢ 2020-11-29 23:55

Why do I have to specify a type for a bit field?

struct MyBitField
{
    unsigned int i : 4;
}

struct MyBitField2
{
    unsigned char i : 4;
}
相关标签:
回答
  • 消灭零回复
提交回复
热议问题