作者hirofumisyo (Ami)
看板C_and_CPP
标题[问题] typedef 定义里的 ":"
时间Thu Dec 13 15:37:07 2018
大家好,
请问下列这段程式码里:後加上数字代表什麽意思呢?
本来以为是宣告初值,
但实际上用DEV C++试着跑一个简单的code发现不是这样,
谢谢大家!
typedef struct ch_properties {
unsigned int amplitudeScale :14;
unsigned int :2;
unsigned int amplitudeOffset :14;
unsigned int :2;
uint32_t counterWrap;
uint32_t startOffset;
uint32_t counterStep;
unsigned int :2;
uint32_t buffReadPointer :14;
unsigned int :16;
uint32_t cyclesInOneBurst;
uint32_t burstRepetitions;
uint32_t delayBetweenBurstRepetitions;
} ch_properties_t;
--
※ 发信站: 批踢踢实业坊(ptt.cc), 来自: 61.230.123.165
※ 文章网址: https://webptt.com/cn.aspx?n=bbs/C_and_CPP/M.1544686633.A.26E.html
1F:→ petercoin: struct的bit field 12/13 15:38
感谢大大的回答!
※ 编辑: hirofumisyo (61.230.123.165), 12/13/2018 15:40:11
2F:推 cuteSquirrel: 位元宽度 12/13 20:43
3F:推 CoNsTaR: 别傻了 不要以为我们不知道你其实是来战 devc++ 的 12/14 01:52
4F:→ sarafciel: 楼上XDD 12/14 11:23
5F:推 BlazarArc: XDDD 12/14 23:04