我有這個功能無符號字符數組指針參數不相容
unsigned char NCN_System_upload(unsigned char *data, unsigned char len);
我有一個數組定義爲這樣:
unsigned char data[3];
我使用的函數,如下所示:
NCN_System_upload(&data, 3);
但是,我收到以下錯誤:
argument of type
unsigned char (*)[3]
is incompatible with parameter of typeunsigned char*
爲什麼不工作?
數組自然衰變爲指針,所以不需要address-of運算符。 –