size of array of pointers

I need to pass an array of bytes by reference to a function that has to figure out how many bytes there are in the array it receives.

const int conSizeArray = 25;

byte bytTest[conSizeArray];

String bytArrayToString(byte *bytArray[])
  String strRetVal = F("bytArrayToString - array size=");
  return strRetVal;

void setup()

  String strTemp = bytArrayToString(*bytTest);


void loop()

but instead of giving the the size of the array (25) its giving me the size of a single pointer (stored in an int of size 2 bytes)

Serial port result:
bytArrayToString - array size=2

The elements of an array is the size of the array divided by the size of the first element.

You cannot generally find out in the function what the size is from just the pointer (except for a nul terminated C string). You need to pass the size as a parameter from wherever the array is actually in scope.

#define ARRAY_SIZE(a) (sizeof(a)/sizeof((a)[0]))

String bytArrayToString(byte *bytArray, byte size)


bytArrayToString(bytTest, ARRAY_SIZE(bytTest));

thought maybe there was a way.