remif1.cpp

remif1.cpp

#include ‹stl.h›

#include ‹iostream.h›

bool odd(int a_) {

 return a_ % 2;

}

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

int main() {

 remove_if(numbers, numbers + 6, odd);

 for (int i = 0; i ‹ 6; i++)

 cout ‹‹ numbers[i] ‹‹ ;

 cout ‹‹ endl;

 return 0;

}