hi guys, im trying to do map in cpp using STL and when i ran a simple program it was showing error that:
error:
nomatchfor'operator<<'in'std::cout<<(&mp0_iter)->std::_Rb_tree_iterator<_Tp>::operator* [with _Tp = std::pair<const int, int>]()'....
my program was like this:
#include<map.h>
#include<iostream.h>
int main()
{
map<int,int>::iterator mp0_iter;
map<int,int>mp0;
map<int,int>mp1;
mp1.insert(1,13);
mp1.insert(2,16);
mp1.insert(3,17);
for(mp0_iter=mp1.begin();mp0_iter!=mp1.end();mp0_iter++)
{
cout<<*mp0_iter<<' ';
}
cout<<endl;
return(0);
}