remcpif1.cpp

We use cookies. Read the Privacy and Cookie Policy

remcpif1.cpp

#include ‹stl.h›

#include ‹iostream.h›

bool odd(int a_) {

 return a_ % 2;

}

int numbers[6] = {1, 2, 3, 1, 2, 3};

int result[6] = {0, 0, 0, 0, 0, 0};

int main() {

 remove_copy_if(numbers, numbers + 6, result, odd);

 for (int i = 0; i ‹ 6; i++) cout ‹‹ result[i] ‹‹ ;

 cout ‹‹ endl;

 return 0;

}