add array a to multiset : multiset insert « set multiset « C++ Tutorial






#include <iostream>
#include <set>
#include <algorithm>

using namespace std;

int main()
{
   const int SIZE = 10;
   int a[ SIZE ] = { 7, 22, 9, 1, 18, 30, 100, 22, 85, 13 };
   typedef multiset< int, less< int > > ims;
   ims intMultiset;    // ims for "integer multiset"

   ims::const_iterator result;

   intMultiset.insert( a, a + SIZE ); // add array a to multiset

   return 0;
}








19.16.multiset insert
19.16.1.Insert 4 again to an integer set and process return value
19.16.2.Insert elements in array to a multiset
19.16.3.Insert element to a multiset
19.16.4.add array a to multiset