Checking words in a string.
So an exercise I have is to read each line from a input file to determine if an arbitrary words is used in each of the lines. I have read the file in and used getline to store each line in a string. However, Im not sure how to then loop through the string to see if the word is there? Do I have to break the string down and store in a vector? The code so far is:
cout << "Enter file name: ";
cin >> name;
cout << "Enter a word to search for: ";
cin >> word;