I'm using a library that creates a multidimensional array in this way:
const unsigned short arrayA[5] = {1, 2, 3, 4, 5};
const unsigned short arrayB[3] = {7, 8, 9};
const unsigned short *multiArray[] ={arrayA, arrayB};
I get the values of it and it works:
printf("03: %d\n", multiArray[0][3]); //4
printf("12: %d\n", multiArray[1][2]); //9
The problem comes when I need to get the size of any of the arrays, I've tried this:
printf("Size of first array: %ld \n", sizeof(multiArray[0])/sizeof(multiArray[0][0]));
It returns 2, probably because it's using addresses.
How can I get the size of the array then?
I have to do this trying not to change the way the arrays are declared, so the arrays are already there and I just need to get the size.
Any approaches?