>as my version of VC++ doesn't recognize the '::mapped_type'
That should teach you to use standard options when they exist:
#include <iostream>
#include <map>
#include <utility>
using namespace std;
typedef pair <const int, int> cInt2Int;
int main()
{
map<int, int> m1;
map<int, int>::value_type value1;
map<int, int>::iterator pIter;
int key1, mapped1;
// value_type can be used to pass the correct type
// explicitly to avoid implicit type conversion
m1.insert ( map<int, int>::value_type ( 1, 10 ) );
// Compare other ways to insert objects into a map
m1.insert ( make_pair ( 2, 20 ) );
m1[3] = 30;
// Initializing key1 and mapped1
key1 = m1.begin()->first;
mapped1 = m1.begin()->second;
cout<<"The key of first element in the map is "<< key1 <<".\n";
cout<<"The data value of first element in the map is "<< mapped1 <<".\n";
cout<<"The keys of the mapped elements are:";
for ( pIter = m1.begin(); pIter != m1.end(); pIter++ )
cout<<" "<< pIter->first;
cout<<".\n";
cout<<"The values of the mapped elements are:";
for ( pIter = m1.begin(); pIter != m1.end(); pIter++ )
cout<<" "<< pIter->second;
cout<<"."<<endl;
} I'm a programmer. My attitude starts with arrogance, holds steady at condescension, and ends with hostility. Get used to it.