ptrunf2.cpp

ptrunf2.cpp

#include ‹iostream.h›

#include ‹stl.h›

bool even(int n_) {

 return (n_ % 2) == 0;

}

int array[3] = {1, 2, 3};

int main() {

 int* p = find_if(array, array + 3, ptr_fun(even));

 if (p != array + 3) cout ‹‹ *p ‹‹ " is even" ‹‹ endl;

 return 0;

}