the function first search a word from the linked list. if found it then increment the numWords (number of words in listfor that word) and if not found it shoud create a new node for the word.
the code is:
void AddWords( char text[30])
{
check=head;
while (check!=NULL)
{
if (strcmp(check->words,text[30])==0)
{
check->numWords++;
break;
}
else
{
newNode=getmem();
strncpy(newNode->words,text, 29);
newNode->next=head;
head=newNode;
}
check=check->next;
}
i am having this compiler error:
Warning] passing arg 2 of `strcmp' makes pointer from integer without a cast
for this line of code:
if (strcmp(check->words,text[30])==0)