Hi. It's me again. Can anyone figure why the first code listing, doesnt work despite passing in the correct values?
Whereas if I hardcode the values in the 2nd listing, it works.
Listing One.
Code:
int PartialFind(char *f)
{
node *curr = NULL;
curr = LastNode;
while(curr)
{
if(strstr(curr->IC,f)==NULL)
return 0;
else
{
printf("Found!");
return 1;
}
curr = curr->Next;
}
return 0;
}
Listing Two:
Code:
int PartialFind(char *f)
{
node *curr = NULL;
curr = LastNode;
while(curr)
{
if(strstr("HairyPotter","airy")==NULL)
return 0;
else
{
printf("Found!");
return 1;
}
curr = curr->Next;
}
return 0;
}