I very briefly looked at the problem description. These are some general guidelines.
1: Decide what a word is. To do this you need to determine what is a non-word, and you must terminate on non-words.
2: Note that once a 'word' has been discovered, the next issue is to discover the start of the next word.
3: General paradigm is: <leading><word><word terminator>
a. <leading> ignore leading characters which do not constitute a word.
b. <word> count characters in word.
c. <word terminator> recognize end of a word.
I have left all the details out. This is a problem that you have to solve. The general 'wc' counts characters, words, and lines. You have to determine what is a countable character, word, and line.
1. "A line is defined as a string of characters delimited by a <newline> character"
To read one line from stdin, use std::string line ; std::getline( std::cin, line ) ;
The number of characters which were read to extract the line would be line.size() + 1
(+1 is for the <newline> character which was extracted and discarded.)
Keep reading lines in a loop till input fails while( std::getline( std::cin, line ) ) { /* process line */ }
2. "A word is defined as a string of characters delimited by white space characters."
3. for the --uwords option, add every word extracted to a set std::set<std::string> unique_words ;
The number of unique words would be size of the set unique_words.size() at the end of the program.
Note that the skeleton already has #include <set>