Struct and Funtkion übergeben
-
Hallo, meine struct sieht folgendermaßen aus:
struct LinListe { char Wort[100]; int Wert; struct LinListe *next; }ListeElement;
dazu habe ich noch einen zeiger auf LinListe zum verwalten der Elemente:
struct Linliste *Kopf = malloc(sizeof(struct LinListe));
und mein Prototyp so:
struct Linliste *addSortet(struct Linliste *Liste, struct Linliste *NewElement)
In der main rufe ich nun addsortet auf und übergebe die Parameter folgendermaßen:
addSortet(Kopf,&ListeElement);
Bei der Übergabe von Kopf ist alles in Ordnung, bloße beim 2ten Argument kommt folgender Fehler:
..\src\LineareListe_Strings.c:67: warning: passing argument 2 of 'addSortet' from incompatible pointer type ..\src\LineareListe_Strings.c:30: note: expected 'struct Linliste *' but argument is of type 'struct LinListe *'
was mache ich falsch?
Vielen Dank im voraus
zoro
-
Vergleiche mal genau 'Linliste' mit 'LinListe'
-
Hahah, ok Danke!
manchmal sinds die kleinen Fehler, habe deswegen extra noch Groß und Kleinschreibung getrennt :p