top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

How to initialize a map in C++?

+1 vote
606 views

How to initialize a map in C++, please explain with example?

posted Jan 9, 2016 by anonymous

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+1 vote

In C++14, following is the code segment:

#include 'bits/stdc++.h'
using namespace std;
main()
{
  //for initialization
  map<int,int> new_map_created={{1,2},
                                {3,4},
                                {5,6}};  
}
answer Jan 26, 2016 by Shivam Kumar Pandey
...