I'm trying to use information that is stored in a linked list node to compare it to a key. The data in the node is a char array in a structure. The key is a user inputed char array. I want to compare the two for a sort of the linked list. Last name to Last name. It doesn't work. I'm unable to see why it doesn't work.
Below is the code I'm using.
Code:
//prototype
bool compare(const char*,const char*);
//key declaration
char Key[SIZE];
//structure definition
struct link
{
short age;
short weight;
char fname[SIZE];
char lname[SIZE];
char ssnumber[SIZE];
link *next;
};
//my function call
compare(current->lname,Key)
//definition function
bool compare(const char* node,const char* key)
{
if(strcmp(node,key))
return true;
else
return false;
}
I get the following errors
(1)linked lists error LNK2019: unresolved external symbol "private: bool __thiscall linklist::compare(char const *,char const *)" (?compare@linklist@@AAE_NPBD0@Z) referenced in function "public: void __thiscall linklist::delete_key(void)" (?delete_key@linklist@@QAEXXZ)
(2)linked lists fatal error LNK1120: 1 unresolved externals