What happens when you attempt to compile and run the following code?
#include
#include
#include
#include
using namespace std;
void myfunction(int i) {
cout << " " << i;
}
bool classifier(int v) {
return v%2==0;
}
int main() {
int t[] = { 1, 5, 2, 5, 2, 4, 4, 3, 3, 1 };
vector
set
replace(v1.begin(), v1.end(),classifier, 10);
for_each(v1.begin(), v1.end(), myfunction);
return 0;
}
Program outputs:
Nell
1 months agoDelmy
4 days agoEmile
5 days agoJuan
17 days agoMan
1 months agoJanet
11 days agoMuriel
14 days agoAsuncion
15 days agoOzell
2 months agoJanna
2 months agoMeghann
2 months agoOllie
28 days agoNana
1 months agoJess
1 months agoColette
2 months agoGianna
2 months agoJanna
2 months ago