Passing complete array to function

Hi, I'm a bit stuck on passing an array to a function.
I have a few arrays of different lengths. let say:

int Array01[] = {1,2,3,4,5};
int Array02[] = {9,5,7};
int Array02[] = {9,5,7,3,6,5,1,2,8,9,7,5};

I have a function which I want to use to just sent out all values in these arrays to a port.
From the main loop I want to sent out the Array to the transferProgram function. Something like:

transferProgram(Array01[]);

And catch the data to sent it out:

void transferProgram(...)
{
//catch the array to sent out the array to a port
}

How can I get these arrays of different sizes into that function?
I've read several websites but for some reason I can't find a good example. :o
Thanks in advance for your help!

Pass the array and its size to the function

You cannot calculate the size in the function because the array will be passed as a pointer

transferProgram(Array01, sizeof(Array01)/sizeof(Array01[0]));
void transferProgram(int anyArray[], int size)
 { 

 }

Ah great! Got it working now! Thanks a lot!

Now that I'm a bit further I stumbled into another problem...

I have a lot of arrays like this one and their bigger then showed here.

word Program_01[] = {0x0017, 0x0000, 0x0017, 0x7240, 0x3017};

Because there are a lot of them and they are constants, I want them to be turned into a const PROGMEM. So I turned it into:

const PROGMEM word Program_01[] = {0x0017, 0x0000, 0x0017, 0x7240, 0x3017};

In the rest of my code I used these lines to load that array into the next function.

 if (ProgramNumber==0x01) {LoadProgram(Program_01, sizeof(Program_01));}

void LoadProgram(word TheProgram[], int ProgramLength)
  {
  
  }

But after adding "const PROGMEM" I got this compile error:

warning: invalid conversion from 'const word* {aka const unsigned int*}' to 'word* {aka unsigned int*}' [-fpermissive] if (ProgramNumber==0x01) {LoadProgram(Program_01, sizeof(Program_01));}

note: initializing argument 1 of 'void LoadProgram(word*, int)' void LoadProgram(word TheProgram[], int ProgramLength)

I don't really get where this goes wrong? Do I have to copy the array to RAM first before I can use it?

sizeof(Program_01)Does not return the number of elements in the array, simply the number of bytes it occupies.
To get the number of elements, divide by the sizeof one element.

AWOL:

sizeof(Program_01)

Does not return the number of elements in the array, simply the number of bytes it occupies.
To get the number of elements, divide by the sizeof one element.

Yes I've seen that. In the LoadProgram I divide that value by 2. But that is not the problem here...?

The sketch compiles normal and works great. But when I just
add "const PROGMEM" in front of the array, I got these compiles errors...

Maybe It was better to start a new topic on a new problem here...

add "const PROGMEM" in front of the array, I got these compiles errors

Hint: We can't see your code.

-solved-