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:
Kathrine
3 months agoBeata
3 months agoMerlyn
3 months agoGladys
4 months agoShaquana
4 months agoJennie
4 months agoGerald
4 months agoThea
4 months agoKanisha
5 months agoIra
5 months agoLouann
5 months agoKiley
5 months agoIzetta
5 months agoQuentin
5 months agoUna
9 months agoPamela
10 months agoCarmelina
10 months agoAbraham
9 months agoJules
10 months agoMirta
8 months agoRenay
9 months agoJacqueline
10 months agoLawrence
10 months agoRonald
9 months agoJohana
9 months agoAron
9 months agoHildred
9 months agoJoanna
10 months agoBrice
10 months agoMona
10 months agoDulce
11 months agoReiko
11 months agoCristy
11 months ago