int GetChar (int NumChar, int MaxNumChar [NumChar])
An entire array is never passed into a function, only its address. So you can either pass that as a pointer or declare the function like this -
Code:
int GetChar (int NumChar, int MaxNumChar [])
which is pretty much the same as passing in an int *.
To pass the array, all you have to do is -
Code:
int myArray[4];
int GetChar(4,myArray);
referring to the name of an array without using square brackets returns the address of the array or better the address of the first element, which is equivalent to &myArry[0].
how do I return the characters read in this function back to main?
You cant return an array from a function either. Only its pointer. However, since arrays are passed using a pointer whatever changes you make inside the function will be made to the original array as well.