Frage

i have the following struct defined:

typedef struct PList{
    Person person;
    struct PList *nextPerson;  //  set to NULL by default <<<<<
}PList;

and this method:

int length(struct PList* db){
    PList* cur = db;
    int size = 0;
    while (cur != NULL){
    ++size;
    cur = cur->nextPerson;
}
    return size;
}

error: conflicting types for 'length' is being thrown at the signature for the length method.

Any ideas?

War es hilfreich?

Lösung

That actually means that there is another function/declaration called length elsewhere in your source code structure that has a different function signature.

Find where length() function is defined, and pass correct structure objects to that function(either of type struct PList or PList*)

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top