however I cant seem to get it to find any white spaces other than the first one when find() is called.
I think the reason why the code doesn't work
the way you want it to is that you have to skip
over the space just found. Try find(' ', pos + 1).
Code:
while(!poem.eof())
{
getline(poem,Line,'\n');
analyzeLine(Line, longest, nwords, nchars);
//cout << Line << endl;
//cout << nwords << endl;
}
getline(poem, Line, '\n') could reach the eof and
then analyzeLine would be given invalid data I think.
It's better to have your functions do one thing and void
main is bad.