Consider:
A function protoype.Code:void function(long n1[5]);
what are the maximum number of values that I can change back in the main using the parameter I pass in??
Printable View
Consider:
A function protoype.Code:void function(long n1[5]);
what are the maximum number of values that I can change back in the main using the parameter I pass in??
For a single dimension array, the number in the brackets is absolutely meaningless - you may just as well leave it empty for all that the compiler cares.
--
Mats
Yes you can alter it.
Usually, you also pass the size of the array to a function:
Code:void show( int n[], int size)
{
while (size--) printf( "%d ", *n++);
printf( "\n");
}
I note that this is the C++ section, so ideally you should be using std::vector or std::tr1::array, rather than manually passing the size of an array. Unless you are using C, of course.