I have uint16_t samples[64]; and use sizeof(samples) / sizeof(samples[0]) to get 64 in main. When I pass the array to void filter(uint16_t buf[]) and use the same expression inside the function, I get 2 on my 32-bit microcontroller and 4 on my PC, so the loop only processes the first few samples.
Why does the same expression give a different answer inside the function, and what is the normal way to write a function that works on arrays of any length?




