Incompatible pointer type

Habe ich die Funktion mit folgender Signatur:

void box_sort(int**, int, int)

und Variablen der folgenden Art:

int boxes[MAX_BOXES][MAX_DIMENSIONALITY+1]

Wenn ich den Aufruf der Funktion

box_sort(boxes, a, b)

GCC gibt mir zwei Warnungen:

103.c:79: warning: passing argument 1 of box_sort from incompatible pointer type (string where i am calling the function)
103.c:42: note: expected int **’ but argument is of type int (*)[11] (string where the function is defined)

Die Frage ist warum? Ob int x[][] und int** x (und eigentlich int* x[]) sind nicht die gleichen Typen in C?

  • Was sind MAX_BOXES und MAX_DIMENSIONALITY? Sind Sie Makros, Konstanten, ... ?
InformationsquelleAutor Boffin | 2010-03-29
Schreibe einen Kommentar