xxxxxxxxxx
//assuming your variables are called : variables_
#include <map>
#include <string>
std::map<int, std::string> map_;
map_[1] = "mercury";
map_[2] = "mars";
map_.insert(std::make_pair(3, "earth"));
//either synthax works to declare a new entry
return map_[2]; //here, map_[2] will return "mars"
map in c++
xxxxxxxxxx
std::map<key_type, value_type> map_name = {{key1, value1},{key2, value2}, };
if {1,1,1,2,2,3,3,3,3,4} then after operation for key1 = 4 value will be 1