i got aproblem in map where i'm trying to cout the map but it come out in different orders. is there is away to make it come out in arranged order.
#include<iostream>
#include<map>
int main(){
std::map<std::string,int> person;
person["Mostafa"]=12;
person["Mickel"]=14;
person["tftf"]=141;
person["Daniel"]=15;
std::map<std::string,int>::iterator it;
for(it=person.begin();it!=person.end();it++){
std::pair<std::string,int> memo=*it;
std::cout<<memo.first<<": "<<memo.second<<std::endl;
}
std::cin.get();
return 0;
}
and the out put is: Daniel: 15 Mickel: 14 Mostafa: 12 tftf: 141