If you wanted to process the elements of your array in a separate function, then you could use code like this (complete program):
#include <stdio.h>
void print_array(int *array, int size) { // function to print the elements of an array
for (int i=0; i<size; ++i) {
printf("Array element %i: %i\n", i, array[i]);
}
}
int main() {
int main_array[] = { 5, 4, 3, 2, 1 }; // create an array and fill it with values
int array_size = sizeof(main_array)/sizeof(main_array[0]); // calculate the number of elements
print_array(main_array, array_size); // call a function to print the values
}
The function print_array() has two arguments, a pointer to an array and the number of elements in the array.
You could also specify the arguments like this; it's the same thing:
void print_array(int array[], int size) {
Notice that there is only one copy of the array, the definition of which is local to main(), but by passing a pointer you can access the elements in another function, using a different name for the array.
You could just make main_array[] a global variable and avoid using the arguments, but that's not a good idea in larger programs.