【发布时间】:2011-09-07 20:24:15
【问题描述】:
我有两个像 map<int,int> 这样的 stl 映射,我想比较它们..所以这里是代码..
map <int, int> a,b;
insert into a and b;
map<int,int>::iterator i;
for(i=a.begin();i!=a.end();i++){
if(what should be here?)
then cout << (*i).first << " also present in b" << endl;
}
我希望类似 (b[(*i).first]).exist??
【问题讨论】:
-
@Kazark : 3 年后这还有用吗?我想我的问题更清楚。