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:
Dulce
9 days agoReiko
11 days agoCristy
13 days ago