< previous page page_888 next page >

Page 888
         <  spaces: MM DD YYYY < endl;
    cin >> month >> day >> year;
    currentDate.Set(month, day, year);
}

//******************************************************************

void GetEntry(
     /* inout */ ifstream&  friendFile,    // Input file of records
     /* out */   EntryType& entry      )   // Next record from file

// Reads an entry from file friendFile

// Precondition:
//     friendFile is open for input
// Postcondition:
//     IF input of the firstName member failed due to end-of-file
//         entry is undefined
//     ELSE
//         All members of entry are filled with the values
//         for one person read from friendFile

{
    char dummy;   // Used to input and ignore certain characters
    int  month;
    int  day;
    int  year;

    friendFile >> entry.firstName;
    if ( !friendFile )
        return;
    friendFile >> entry.lastName;

    friendFile >> dummy                      // Consume (
               >> entry.phone.areaCode
               >> dummy                      // Consume )
               >> entry.phone.number;

    friendFile >> month
               >> dummy                      // Consume /
               >> day
               >> dummy                      // Consume /
               >> year;
    entry.birthDate.Set(month, day, year);
}

//******************************************************************

 
< previous page page_888 next page >