Domanda

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?

È stato utile?

Soluzione

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*)

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top