void PrintArray (int arr[], int size) { for (int i = 0; i < size; i++) cout << arr[i] << ' '; }Note that:
int list[5] = {2, 4, 6, 8, 10}; PrintArray(list, 5); // will print: 2 4 6 8 10
void PrintArray (const int arr[], const int size) { for (int i = 0; i < size; i++) cout << arr[i] << ' '; }Notice that the const on the variable size is a good idea in this example, too. Why?