Hi, I am trying to search for a word I have entered into a list. I could list all entries so far. But I am having a hard time figuring out a function that can search for a particular word on the list. Below are the codes. I commented out different functions I have tried. Thank you!
boolean searchWord (VOCAB V[])
{
int i;
char target[LENGTH];
printf("\nEnter the Word you want to search: ");
fflush (stdin);
gets (target);
for ( i=0; i<SIZE; i++)
{
// if ( target == V[i].Word )
//if ( strcmp( target, V[i].Word ) == 0);
if (strncmp (V[i].Word,"target") == 0)
{
return 0;
}
return 1;
}
}