[prev] [index] [next]

Arrays and Functions

When an array is passed as a parameter to a function
  • a pointer to the start of the array is actually passed
Example:

int total, vec[20];
...
total = sum(vec);

Within the function ...

  • the types of elements in the array are known
  • the size of the array is unknown