The real power of being able to interchange an array name with a pointer is when we use an array name (or a pointer to an array) as a parameter to be passed into a function. In this section, we will explore the four possible ways of using an array in a function parameter:
- Pass an array name in a parameter and then use array notation in the function.
- Pass a pointer to an array in a parameter and then use the pointer in the function.
- Pass an array name in a parameter and use that as a pointer in the function.
- Pass a pointer to an array in a parameter and use array notation in the function.
The third and fourth methods should now come as no surprise to you. In the arrays_pointers_funcs.c,program, we'll create the function prototypes for each of the functions, set up a simple array that we want to traverse, print out some information about the array's address...