I need some assistance with the strcmp function. I am trying to compare a const char word with a char array.But for whatever reason, strcmp is not comparing the two types.Here is what I have:
typedef struct Node {
char word[LENGTH+1];
struct Node *Next;
}
Node;
for (NodePointer=hashtable->table[hashval];NodePointer !=NULL;NodePointer=NodePointer->Next)
{
i=0;
i=strcmp(word,NodePointer->word);
if (i==0)
return true;
}
return false;
}
does anyone have any idea on what maybe the problem? Am I suppose to null terminate each beforehand?