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!
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.
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...