replace0.cpp
replace0.cpp
#include ‹stl.h›
#include ‹iostream.h›
int numbers[6] = {0, 1, 2, 0, 1, 2};
int main() {
replace(numbers, numbers + 6, 2, 42);
for (int i = 0; i ‹ 6; i++) cout ‹‹ numbers[i] ‹‹ ;
cout ‹‹ endl;
return 0;
}
replace0.cpp
#include ‹stl.h›
#include ‹iostream.h›
int numbers[6] = {0, 1, 2, 0, 1, 2};
int main() {
replace(numbers, numbers + 6, 2, 42);
for (int i = 0; i ‹ 6; i++) cout ‹‹ numbers[i] ‹‹ ;
cout ‹‹ endl;
return 0;
}