Ok, so I am suppose to open, read, and print information from a data file to the
ID: 3643080 • Letter: O
Question
Ok, so I am suppose to open, read, and print information from a data file to the screen (I can do that). Then I am suppose to take only certain information from that file to use for another function in my program. This is what I am using to read and print the file to the screen:while(getline(fin, line))
{
cout<<line<<endl;
}
I know that I need to break each line into "words". I can't seem to get it right.
For example, if each line of data in the file states a course number, credit hour, and letter grade, and I only want to pull out the letter grade so I can convert it into a number grade, how can I do this?