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
19 days agoPamela
22 days agoCarmelina
23 days agoJules
25 days agoJacqueline
20 days agoLawrence
1 months agoRonald
24 hours agoJohana
2 days agoAron
8 days agoHildred
18 days agoJoanna
21 days agoBrice
23 days agoMona
25 days agoDulce
2 months agoReiko
2 months agoCristy
2 months ago