This is what I am trying to do, this is not nearly the entire program I am making just a small portion. This part is counting the # of words of what I enter.
string s;
getline(cin, s);
for (unsigned int i = 0; i < s.length(); i++)
{
if (s[i] == ' ' || s[i] == '.')
{
numWords++;
}
}
This obviously works if someone enters a correct line with a period at the end. I can't think of how to get it to recognize the end of line character though, incase they don't put a period.