int main(int argc, char*argv[])
{
char word[MAXWORD]; /* current word */
Words matches; /* list of matching words */
char *substring; /* string to look for */
FILE *input; /* the input file */
/* ... Check command-line arguments and open input file ... */
/* Process the file - find the matching words */
matches = NULL;
while (getWord(input, word) != NULL) {
if (contains(word,substring) && !member(word, matches))
insert(word, &matches);
}
printWords(matches);
return 0;
}
|