std::map判断一项是否存在

std::map<int, string>::iterator iter;
iter = map.find(1);
if(iter != map.end())
{
    std::cout<<”Find, the value is ”<<iter->second<<endl;
}

 

posted @ 2022-09-15 11:54  远方是什么样子  阅读(374)  评论(0)    收藏  举报