반응형
map 사용하기
#include<iostream> #include<map> #include<string> using namespace std; int main() { map<string,float> testMap; testMap["AB"]=0.1; testMap["CD"]=0.2; testMap["EF"]=0.3; map<string,float>::iterator it; for( it = testMap.begin() ; it != testMap.end() ; it++ ){ cout <<"key : " << it->first << " , " <<"value : " << it->second << endl; } }
반응형