home
search
help
profile
liking the experience? our app is even better
registration for
employee referral programs
are now open
get referred to google, amazon, flipkart and more
register now  
showing results for map c 2b 2b example
1// map::at
2#include <iostream>
3#include <string>
4#include <map>
5
6int main ()
7{
8  std::map<std::string,int> mymap = {
9                { "alpha", 0 },
10                { "beta", 0 },
11                { "gamma", 0 } };
12
13  mymap.at("alpha") = 10;
14  mymap.at("beta") = 20;
15  mymap.at("gamma") = 30;
16
17  for (auto& x: mymap) {
18    std::cout << x.first << ": " << x.second << '\n';
19  }
20
21  return 0;
22}
upvote
downvote
source
queries leading to this page
map in c 2b 2b