3,881
社区成员
发帖
与我相关
我的任务
分享
map<string, int> mmap;
mmap.insert(pair <string, int>("M1", 0x05100f0f));
// 获取选取的值:
string sSelected = "L";
int nValue;
map<string, int>::iterator it = mmap.find(sSelected);
if (it != mmap.end())
{
nValue = it->second; // nValue就是你想要的值
}