text cover

Data Abstraction and Problem Solving with C++

Walls and Mirrors

by Frank M. Carrano

Addison Wesley Logo

example207.cpp

Go to the documentation of this file.
00001 
00016 // Saves a linked list's data in a text file of
00017 // integers; head points to the linked list.
00018 
00019 // fileName is a string that names an external text
00020 // file to be created
00021 ofstream outFile(fileName);
00022 
00023 // traverse the list to the end, writing each item
00024 for (Node *cur = head; cur != NULL; cur = cur->next)
00025    outFile << cur->item << endl;
00026 
00027 outFile.close();
00028 // Assertion: The text file contains the linked
00029 // list's data in its original order.

Generated on Sun Aug 27 13:05:37 2006 for AWLogo by  doxygen 1.4.6