The problem is that only the last entered line words are counted.
The other words are not counted
If at runtime i enter the words
const int n=80;
cout<<"\nDisplay all records\n\n";
cout<<"\nTotal number of lines = "<<nol-1<<"\n";
cout<<"\nTotal number of words = "<<now-1<<endl;
the word counter outputs only 2 and not all the words from the file, even though the file contains many more words.
But "working" is never output. However when I try
The word "working" is displayed on the screen.