0
Q:

map insert c++

 // initialize container 
    map<int, int> mp; 
  
    // insert elements in random order 
    mp.insert({ 2, 30 }); 
    mp.insert({ 1, 40 }); 
  
    auto it = mp.find(2); 
  
    // inserts {3, 6} starting the search from 
    // position where 2 is present 
    mp.insert(it, { 3, 60 }); 
  
2
  mymap.insert ( std::pair<char,int>('a',100) );
1

New to Communities?

Join the community