首页 > 编程语言 > 详细

C++中map的一点疑惑...

时间:2016-06-30 12:40:26      阅读:167      评论:0      收藏:0      [点我收藏+]

int CRuntimePara::getInt(const string& strKey,int iDefault)
{
map<string,string>::const_iterator iter;

if ((iter = _mapParaValue.find(strKey)) != _mapParaValue.end())
return atoi((*iter).second.c_str());
else
return iDefault;
}

 

_mapParaValue.end()

-----------------------------------------------------------------------------------------

class CRuntimePara
{

...

private:
std::map<std::string,std::string> _mapParaValue;
};

------------------------------------------------------------------------------------------

_mapParaValue.end()为map里的end的返回置为Returns an iterator referring to the past-the-end element in the map container.返回指向_mapParaValue容器尾元素之后位置的迭代器               若begin == end

 

C++中map的一点疑惑...

原文:http://www.cnblogs.com/the-tops/p/5629357.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!