You've read a line from the text file into
word
, now you need to break the line down into individual words. There's multiple ways to do that, but maybe you should look at using
string.find_first_of()
and
string.substr()
. You'd use
find_first_of()
to find the next puctuation character in the line, then use
substr()
to generate a single word, that you could then test to see if it is the longest or shortest word.
Documentation for std::string can be found here:
std::basic_string - cppreference.com[
^]