We will not be studying the material on pp. 517-536 in this CMPSC 101 course.

Objective #1: Understand the uses for data files.

Objective #2: Understand the difference between sequential-access and random-access data files.

Objective #3: Open and close data files.

Objective #4: Write to data files.

Objective #5: Read from data files.

Objective #6: Add to the end of a data file.

ofstream appendFile;
appendFile.open("mydata.txt", ios::app);

rather than

appendFile.open("mydata.txt");

or

appendFile.open("mydata.txt", ios::out);

Objective #7: Detect the end of a file.

while (!infile.eof())
{
    infile >> x;
    cout << x << endl;
}

Objective #8: Use multiple data files at the same time and insert data into the middle of a sequential access file.