作者qeagle ()
看板C_and_CPP
標題[問題] 這樣的引數型態要給什麼值當輸入?
時間Thu Jun 18 00:33:24 2015
uint8_t LTC6804_rdcv
(uint8_t reg, // Controls which cell voltage register is read back.
uint8_t total_ic, // the number of ICs in the system
uint16_t cell_codes[][12] // Array of the parsed cell codes
)
大家好,由於我不太懂指標,想請問若有上面那樣一個函式可以用
我對第三個引數有點疑問
cell_codes[][12]這個指標的第一個index內沒有設大小
是不是代表我在呼叫這個函式的地方,
先宣告一個矩陣,再把起點傳過來即可
比如我希望傳進來是一個3*12的指標起點
uint16_t A[3][12]
呼叫函式時用LTC6804(ARG1,ARG2,A[0][0])
即可?
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 1.163.114.12
※ 文章網址: https://www.ptt.cc/bbs/C_and_CPP/M.1434558806.A.71D.html
→ EdisonX: LTC6804(ARG1, ARG2, A[0]) 06/18 00:56
→ EdisonX: 第三個引數代表 (指向具有 12 個整數陣列) 的指標 06/18 00:57
→ EdisonX: 所以 A[0], A[1] , A[2] 都可能用到 06/18 00:58