On May 5, 9:08=A0pm, mdh <m...@[EMAIL PROTECTED]
> wrote:
> Thanks all who replied. I did know that an address is passed to a
> function when an array is passed as an argument, but I had not seen it
> done like this, although it makes perfect sense.So, I guess that the
> expectation of a function when getting an array as a parameter, is to
> receive a pointer, no matter how the argument is formulated ( as an
> array or pointer), with the exceptions ( of which I was unaware)
> above. Thank you again.
A function cannot take an array as a parameter. If you do the
following:
void Func(int arr[5])
{
}
Then it's EXACTLY the same as writing:
void Func(int *arr)
{
}
Try it out:
void Func(int arr[5])
{
int i;
arr =3D &i; /* arr is just a pointer to int */
}


|