index | next

Passing Arrays to Functions

Consider the following function, which takes an int array as an argument:

void display(int v[], int n) {
  for (int i = 0; i < n; i++) {
    cout << setw(4) << v[i];
  }
  cout << endl;
}


index | next