hello guys i am new to maps in C++ i am having a question regarding copying a particular type map to another map of same kind the details are shown below I initially declared a map like this
map<string,int> objmap,obj_porcess ;
for(int i = 0; i < 10]; i++) {
obj_process[to_string(i)]=i+10//some processing the to_string is just in case but i have strings with names for all 10 values
}
like
obj_process["today"]=1;
obj_process["yesterday"]=-1;
obj_process["tommorow"]=2;
now i want to define some thing like this just my key word should be added with the process and remaining all can be same for all the keys from obj_process
objmap["process_"+"today"] = obj_process["today"];
instead of defining all 10 can i have a simple code cause in here i took an example of 10 but i have like 200 set of different strings in the key of map
Aucun commentaire:
Enregistrer un commentaire