Recalling from the previous tutorial about the getline() function, input from text files are used in that fashion. Input of files also require the <string> library for the getline() function.
Here is an example of file input. The file must be created first in order for this to work.
This program will attempt to read a file for input, display the line you read and then close the file.
Here is some information about the new function eof() which stands for "end of file".
The eof() function is a boolean function that will check whether or not the file has reached the end. It returns true when the file is at the end and false otherwise.