Menu

[solved] – Question 79818

The following code defines a multimap associative container and inserts some initial values. Add code for a second multimap associative container and algorithm statements that search for duplicates in the original container and move those duplicate keys and values to the new container (deleting the entries from the original container).

#include <map>
using namespace std;

int main()
{
multimap< int, int, less< int > > container8;

container8.insert( make_pair ( 7, 24 ) );
container8.insert( make_pair ( 7, 16 ) );
container8.insert( make_pair ( 4, 56 ) );
container8.insert( make_pair ( 4, 72 ) );
container8.insert( make_pair ( 3, 17 ) );
container8.insert( make_pair ( 7, 41 ) );
container8.insert( make_pair ( 2, 12 ) );
container8.insert( make_pair ( 5, 67 ) );
}

Expert Answer


OR


Leave a Reply

Your email address will not be published. Required fields are marked *