What I want you to do is to alter the program so that in addition to the count of appearances of each word, it keeps track of what lines the word appears on. To do this, you will have to alter the word class to use a vector or a list container. Every time you see a word, you have to add the line number to the container. Only add a line number once for each word. For example, in the line below, the word the appears several times but the line number should only be in the list for 'the' once.
That is in the line below, the word the appears several times but theIf you want to do a little research on your own and study the set container described in Chapter 15, you can use that.
You should alter the print routine to show the line numbers for each word.
EXTRA CREDIT:
For 5 points, write a function that takes a line number as an argument
and prints the words that appear on that line.
I have written a solution to this and the example executable and data file
are in this zip file.
Running it may help clarify what I want.