【发布时间】:2015-05-10 16:53:13
【问题描述】:
所以我在 AVR GCC 中编程,我已经查看了一些关于这个警告的类似问题,但我似乎无法找到一个明确的解决方案。
当使用多维数组中的数组作为函数的指针参数时,我收到此警告:
// Prototype
int getneighbours (uint8_t *neix[], uint8_t *neiy[], uint8_t nodex, uint8_t nodey);
// Call
uint8_t neighbours[2][4];
getneighbours (&neighbours[X], &neighbours[Y], nodex, nodey);
// Message
expected 'uint8_t **' but argument is of type 'uint8_t (*)[4]'
我之前一直很害怕在多维数组中使用指针,但我真的很想知道如何避免收到此警告?
问候
【问题讨论】:
标签: pointers gcc gcc-warning