////////////////////////////////////////////////////////////// // // listtester.cpp // // Shows a few simple uses of the C++ Standard Template // library list template. // // Jeff Ondich, 1/31/03 // ////////////////////////////////////////////////////////////// #include #include #include int main() { list theList; string s; // Build the list from input. cout << "Type some stuff followed by CTRL-D alone on a line." << endl; while( cin >> s ) theList.push_back( s ); // Go through the list using an iterator. cout << endl << endl << "Your list:" << endl; list::iterator it = theList.begin(); while( it != theList.end() ) { cout << *it << endl; ++it; } return( 0 ); }