top button
Flag Notify
    Connect to us
      Facebook Login
      Site Registration

Facebook Login
Site Registration

How to initialize a map in C++?

+1 vote
163 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
Similar Questions
0 votes

I want to get all the map values in c++? Please share sample code?

Contact Us
+91 9880187415
sales@queryhome.net
support@queryhome.net
#280, 3rd floor, 5th Main
6th Sector, HSR Layout
Bangalore-560102
Karnataka INDIA.
QUERY HOME
...