how to send a array through a function.

I have an array called ani

byte ani[][10] ={
 {27,236,63,254,255,191,207,199,57,36},
 {27,236,36,146,193,160,72,68,41,36},
 {27,236,63,254,255,191,207,199,57,36},
 {27,236,36,146,193,160,72,68,41,36}};

in my setup i call void animation with parameter the ani animation

void setup(){
Serial.begin(115200);
Animatie(ani);
}

void Animatie(byte Animation [][10]){
  Serial.println(sizeof(Animation)));
}

But i always get a 0
if i change it to

Serial.println(sizeof(ani));

it works but i don't want that i want to use the variable.

Kind regards

Johan

First, you are sending the array to a FUNCTION, not a VOID.

Second, you are passing the ADDRESS of array to the function. The size of the address tells you nothing about the size of the array. You must pass the size of the array to the function, too.

And how do i do that because it worked like this in 1.05 but now with 1.6.4 it don't work anymore

JOhan

because it worked like this in 1.05 but now with 1.6.4 it don't work anymore

I don't believe that. The size of a pointer has not changed.

Post some real (complete) code - not snippets.

byte someArray[5][5] = { /* some data goes here */ }

void loop()
{
    // size of can tell the size of the array because it IS an array

    myFun(someArray);

    myOtherFun(someArray, 5, 5);
}

void myFun(byte something[][])
{
    // something is a pointer sizeof() knows how big a pointer is. It does NOT know
    // anything about the amount of data the pointer points to
}

void myOtherFun(byte somethingElse[][], byte rows, byte cols)
{
   // This function would KNOW how many rows and how many columns in somethingElse
}