passing array to function

i am learning arrays i want to whats the following effect of cods while passing array to the following function

void fun(array[])
void fun(array[4])
void fun(array[],4)
void fun(array[5],4)

please help me .thank you in advance
Are these supposed to be function calls? Or are they function prototypes?

If the former, then the 1st and 3rd aren't legal.

If the latter, then the 2nd and 4th aren't legal.
i learned that while passing array to function.mentioning size of array is not neccessary to the function being called.is that so
If you're talking about a C-style array, then, yes, you will need to pass the array size. Otherwise, how will the function know how many elements are in the array?

There are some clever template tricks you can use to avoid having to pass the array size, but I'm assuming that's not what you're talking about?

EDIT: Is there any reason you're not answering the question I asked in my previous post?
Last edited on
Topic archived. No new replies allowed.