[問題] typedef 定義裡的 ":"

看板C_and_CPP (C/C++)作者 (Ami)時間7年前 (2018/12/13 15:37), 7年前編輯推噓3(302)
留言5則, 5人參與, 7年前最新討論串1/1
大家好, 請問下列這段程式碼裡:後加上數字代表什麼意思呢? 本來以為是宣告初值, 但實際上用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://www.ptt.cc/bbs/C_and_CPP/M.1544686633.A.26E.html

12/13 15:38, 7年前 , 1F
struct的bit field
12/13 15:38, 1F
感謝大大的回答! ※ 編輯: hirofumisyo (61.230.123.165), 12/13/2018 15:40:11

12/13 20:43, 7年前 , 2F
位元寬度
12/13 20:43, 2F

12/14 01:52, 7年前 , 3F
別傻了 不要以為我們不知道你其實是來戰 devc++ 的
12/14 01:52, 3F

12/14 11:23, 7年前 , 4F
樓上XDD
12/14 11:23, 4F

12/14 23:04, 7年前 , 5F
XDDD
12/14 23:04, 5F
文章代碼(AID): #1S4Wmf9k (C_and_CPP)
文章代碼(AID): #1S4Wmf9k (C_and_CPP)