int array
#include <iostream.h> #include <stl.h>
int array [3] = { 1, 2, 3 };
int main () { replace_if (array, array + 3, binder2nd<greater<int> > (greater<int> (), 2), 4); for (int i = 0; i < 3; i++) cout << array[i] << endl; return 0; }
#include <iostream.h> #include <stl.h>
int array [3] = { 1, 2, 3 };
int main () { replace_if (array, array + 3, bind2nd (greater<int> (), 2), 4); for (int i = 0; i < 3; i++) cout << array[i] << endl; return 0; }