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
2 months agoPamela
2 months agoCarmelina
2 months agoAbraham
24 days agoJules
2 months agoMirta
13 days agoRenay
18 days agoJacqueline
2 months agoLawrence
2 months agoRonald
29 days agoJohana
1 months agoAron
1 months agoHildred
2 months agoJoanna
2 months agoBrice
2 months agoMona
2 months agoDulce
3 months agoReiko
3 months agoCristy
3 months ago