// outiter.cpp // Демонстрация ostream_iterator #include #include #include using namespace std; int main() { int arr[] = { 10, 20, 30, 40, 50 }; list theList; for(int j=0; j<5; j++) //перенести массив в список theList.push_back( arr[j] ); ostream_iterator ositer(cout, ", "); //итератор //ostream cout << "\nСодержимое списка: "; copy(theList.begin(), theList.end(), ositer); //вывод //списка cout << endl; return 0; }