Determine size of array from external file

Hi
How can we determine the size of an array that is sent to a function that was defined in another file?
For example:
file1 contains:
...
extern func(int[]);

main()
{
int arr[6];
func(arr);
}

and file2 contains:
...
func(int arr[])
{
//the answer here...?
}

Thanks...
You can't determine the array size if the function is in the same file either. This is because in c++ passing an array means passing a pointer to it. You'll just have to make it void func(int arr[], int len) (or use std::vector or something..)
Topic archived. No new replies allowed.