How to pass Byte_Array[29] into method/function call?

I'm trying to optimize my code and can't figure out how to send a byte array into a method.

Example:

void doSomething(){
   
   byte my_array[29] = {
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x01, 0x01, 0x02,
        0x00, 0x00, 0x00, 0x00, 0x01, 0x00,
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00, 0x00
    };

    doingSomething(my_array);
     
}

void doingSomething(byte input_array){
   // do something with the input_array
}

Any ideas?

void doingSomething(byte input_array){

This function is defined to take a byte, not a byte array.

void doingSomething(byte input_array[])
{ // Down here where it belongs!

This function is defined to take an array.

Tried that but when I do:

void doSomething(){
   
   byte my_array[29] = {
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x01, 0x01, 0x02,
        0x00, 0x00, 0x00, 0x00, 0x01, 0x00,
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00, 0x00
    };

    doingSomething(my_array);
     
}

void doingSomething(byte input_array[]){
   // do something with the input_array
   Serial.println(sizeof(input_array), DEC);
}

The sizeof doesn't give the correct size. hmmm...

The sizeof doesn't give the correct size. hmmm...

Of course not, because what really got passed was a pointer to the start of the array. If you want the function to know the length of the block of memory pointed to, you must also tell it that, typically by telling it the number of elements in the array.

I should mention that sizeof() DID get the correct size - it just wasn't the size you expected.

like: doingSomething(my_array, sizeof(my_array));

void doingSomething(byte input_array, int arraySize){
} // do something with the input_array

??

If the size is known its easy to use pointers, search reference and deference
I had to learn them when I was working with byte arrays myself, after learning how to use them properly its pretty easy
however explainging them is beyond me maybe someone else or google will help

got it! it worked.