Ear*_*rlz 0 c++ bit-manipulation bit-fields c++11
所以我有一个像这样的位域:
unsigned int foobar:1;
Run Code Online (Sandbox Code Playgroud)
然后我使用此代码设置它
uint32_t code = loadCode();
structure.foobar = code & 2;
Run Code Online (Sandbox Code Playgroud)
因此,如果code设置为2,这是否意味着foobar设置为1,0或未定义?我正在使用的确切标准实际上是C++ 11,而不是简单的C.
| 归档时间: |
|
| 查看次数: |
99 次 |
| 最近记录: |