Pointers 警告:传递参数x的';foo';来自不兼容的指针类型

Pointers 警告:传递参数x的';foo';来自不兼容的指针类型,pointers,gcc,gcc-warning,Pointers,Gcc,Gcc Warning,所以我正在用AVRCC编程,我已经查看了一些关于这个警告的类似问题,我似乎找不到一个明确的解决方案 当使用多维数组中的数组作为函数的指针参数时,我收到以下警告: // Prototype int getneighbours (uint8_t *neix[], uint8_t *neiy[], uint8_t nodex, uint8_t nodey); // Call uint8_t neighbours[2][4]; getneighbours (&neighbours[X], &a

所以我正在用AVRCC编程,我已经查看了一些关于这个警告的类似问题,我似乎找不到一个明确的解决方案

当使用多维数组中的数组作为函数的指针参数时,我收到以下警告:

// 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]'
我以前很害怕使用多维数组的指针,但我真的想知道如何避免得到这个警告


关于

我设法想出了一个解决我自己问题的办法:

// Prototype
void getneighbours (uint8_t (*nei)[2][4], uint8_t nodex, uint8_t nodey);

// Call
uint8_t neighbours[2][4];
getneighbours (&neighbours, nodex, nodey);
因此,对于有相同问题的人来说,这就是如何正确处理多维数组指针