For byte size elements you can use sizeof(data).
In general, the sizeof(data)/sizeof(data[0])number of elements will be indicated.
Since this question arose in your last question, I will explain that it is impossible to use when you pass an array to a function as a parameter:
void f(byte arr[])
{
cout << sizeof(arr);
}
void g()
{
byte data[] = {0xc7, 0x05, 0x04, 0x11 ,0x45, 0x00, 0x00, 0x00, 0x00, 0x00};
cout << sizeof(data);
}
source
share