You have two different problems:
1. Tokenize the input stream (extract words from the stream).
2. Build word dictionary.
The second one has a very simple solution: use std::<map> data structure as Laiq Ahmed mentioned above. However you need another code to process every word with the map-based word dictionary:
if the next word is found in the map then
do notning or increment this word counter
else
insert new word in the map
endif
There are lots of methods to solve the 1st problem. For example:
open file stream
create an empty map
loop // until eof
skip non-letters
clear word buffer // use std::string::clear()
append letters to the word buffer
process the word with the map // see #2
endloop
process a possible last word
traverse map (file word dictionary)
Summary:
- use std::ifstream
- use std::string for word buffer
- use std::map<std::string,int> for dictionary with counters
You have a good chance to write a simple and clear code after a proper functional decomposition of pseudocode snippets

...