#include using namespace std ; void print_array( int A[], int n ) { if (n < 1) { cout << "[ ]" << endl ; return ; } cout << "[" << A[0] ; for (int i=1; i < n ; i++) { cout << ", " << A[i] ; } cout << "]" << endl ; return ; } void copy_array( int X[], int Y[], int start, int end ) { for(int i = start; i < end ; i++) { Y[i-start] = X[i] ; } return ; } int main() { int A[] = { 0, 1, 2, 3, 4 } ; A[2] = 777 ; cout << "A = " ; print_array(A, 5) ; int B[3] ; int x ; copy_array(A, B, 1, 4) ; B[1] = 2 ; cout << "B = " ; print_array(B,3) ; cout << "A = " ; print_array(A, 5) ; }