what do you want to search for and what do you want to count? do you want to count the number of times "0012" appears in both lines (and the same for each of the other strings on line 1) ?
one way to do it is to create a structure that contains the word to search for and an integer that is the number of times that word appears in the other lines
struct count
{
char word[20];
int counter;
}
create and populate an array of those stuctures from the words in the first line, then read the second line and search each of the structures for the word. When found increment its counter, then go on to the next word in the second line. continue that until all the words have been read from the file. When finished, you will have a total frequency count for each word.
Ancient Dragon
Retired & Loving It
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
Look into the strstr() function.
WaltP
Posting Sage w/ dash of thyme
10,506 posts since May 2006
Reputation Points: 3,348
Solved Threads: 944