Well you want to replace this
if ( (strstr(entry[i].fname, search_term)) || (strstr(entry[i].lname, search_term)) || (strstr(entry[i].phone, search_term)) )
With this
if ( (match(entry[i].fname, search_term)) || (match(entry[i].lname, search_term)) || (match(entry[i].phone, search_term)) )
Where match has the functionality as described above
At the moment, you would have
Code:
int match ( char *word, char *pattern ) {
return strstr( word, pattern ) == 0;
}
Then start to think about what it means to match against wildcards