Hello everyone, I am new and hope someone can help me! The problem I am working on is:
1 2 3 4 5 6
Write a C++ program that reads several lines of text from a file and prints a table indicating the number of occurrences of each different word in the text. Also, your program should include the words in which they appear in the text. For example, the lines
To be, or not to be: that is a question:
Whether 'tis nobler in the mind to suffer”
contains the words "to" three times, the word "be" two times, the word "or" once, etc.
This is what I have so far! It seems to run fine if I use cin >> string;, but once i load it from the file, the output i get is :