What happens when you attempt to compile and run the following code?
#include
#include
#include
using namespace std;
void myfunction(pair
cout << " " << i.first;
}
int main() {
int t[] = { 10, 5, 9, 6, 2, 4, 7, 8, 3, 1 };
map
for(int i=0; i < 10; i++) {
m[i]=t[i];
}
for_each(m.begin(), m.end(), myfunction);
return 0;
}
Program outputs:
Una
3 months agoPamela
3 months agoCarmelina
3 months agoAbraham
2 months agoJules
3 months agoMirta
2 months agoRenay
2 months agoJacqueline
3 months agoLawrence
4 months agoRonald
3 months agoJohana
3 months agoAron
3 months agoHildred
3 months agoJoanna
3 months agoBrice
3 months agoMona
3 months agoDulce
4 months agoReiko
4 months agoCristy
5 months ago