I would first create a structure
struct words
{
std::string word;
int count;
};
Next an vector (array) of those structures
Now, then the program reads a line, check wordArray if its already in the array. if it is then increment the count. If not, then add a new element to the vector. When done, you will have the information you need to display on the screen.
Another method is to use a <map>, but implementation is left for someone else.
Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.