SOURCE FILE: saveList.cpp


// Saves a linked list's data in a text file of 
// integers. Head points to the linked list.
ofstream F(FileName);  // FileName is a string that 
                       // names an external text file
                       // to be created

// traverse the list to the end, writing each item
for (ptrType Cur = Head; Cur != NULL; 
                         Cur = Cur->Next)
   F << Cur->Item << endl;

F.close();
// Assertion: The text file contains the linked 
// listŐs data in its original order.