我收到此代码的警告。
Warning {
` del2_.c: In function ‘addIntoCell’:`
`del2_.c:401:3: warning: passing argument 1 of ‘resizeArray’ from incompatible pointer type [enabled by default]`
`del2_.c:378:6: note: expected ‘struct t_grapheVertex ***’ but argument is of type ‘struct t_grapheVertex **`
}
这就是我定义函数的方式:
void resizeArray(t_grapheVertex ***ele)
这是我调用函数时的警告:
resizeArray(&(*cell)->elements);
这是单元格的结构:
typedef struct st_cell
{
int nbElements;
struct st_cell* next;
t_grapheVertex* elements;
} t_cell;
void resizeArray(t_grapheVertex ***ele){
t_grapheVertex *temp;
int newSize;
newSize = arraySize*increaseRate ;
temp = realloc(*ele , sizeof(int)*newSize);
if(**ele == NULL)
{
printf("fail to resize\n");
return;
}
else
{
printf("resized succesfully\n");
**ele=temp;
arraySize = newSize ;
}
}