In the following program what is ifstream? It looks like it might be a Class name making file_in an object of that class passing filename as an argument but this particular book hasn't touched OOP yet so I wasn't sure.

#include <iostream>
#include <fstream>
using namespace std;

int main()
{
    int c;  // input character
    int i;  // loop counter
    char filename[81];
    char input_line[81];

    cout << "Enter a file name and press ENTER: ";
    cin.getline(filename, 80);

    ifstream file_in(filename);

    if(!file_in)
    {
        cout << "File " << filename;
        cout << " could not be opened.";

        return -1;
    }

    while(1)
    {
        for(i = 1; i <= 24 && ! file_in.eof(); i++)
        {
            file_in.getline(input_line, 80);
            cout << input_line << endl;
        }

        if(file_in.eof())
            break;

        cout << "More? (Press 'Q' and ENTER to quit.)";
        cin.getline(input_line, 80);
        c = input_line[0];

        if(c == 'Q' || c == 'q')
            break;
    }

    return 0;
}

ifstream is a class that is used for reading files. file_in is an object of the class ifstream and it is used in the program to read from a file. Here is a good reference for what you dan do with an ifstream object.

This question has already been answered. Start a new discussion instead.