copyb0.cpp

We use cookies. Read the Privacy and Cookie Policy

copyb0.cpp

#include ‹stl.h›

#include ‹iostream.h›

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

int main() {

 int result[5];

 copy_backward(numbers, numbers + 5, result + 5);

 for (int i = 0; i ‹ 5; i++) cout ‹‹ numbers[i] ‹‹ ;

 cout ‹‹ endl;

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

 cout ‹‹ endl;

 return 0;

}