Digg StumbleUpon LinkedIn YouTube Flickr Facebook Twitter RSS Reset

Affciher le contenu du ‘set’ avec la méthode ‘copy()’

 méthode, iterator, set
{filelink=15325}

 
#include <iostream>
using namespace std;
#include <set>
#include <algorithm>
#include <iterator> 
 
int tab[ 5 ] = { 1, 4, 5, 2, 37 };
int main()
{
 
   set< int, less< int > > intSet( tab, tab + 5 );;
   std::ostream_iterator< int > output( cout, " " );
 
   cout << "Le contenu du 'set': ";
   std::copy( intSet.begin(), intSet.end(), output );
 
   cout << endl;
   return 0;
}

No comments yet.

Leave a Comment