Hi,

Quote:

What do you mean with size, amount of indexes?



Yes, I've meant the number of elements.

Quote:

Then what are you trying to achieve with sizeof(my_array[0])?



I wanted to calculate the size of a single array element in bytes.
Dividing the array size in bytes by the element size in bytes should result the array's length in elements, if I'm not mistaken.
If arrays are handled as pointers this would not work, though.


Your code works fine, thank you!
However, the last element of the array has to be NULL; otherwise a wrong value is returned:

var my_array[3] = { 1, 2 } // works
var my_array[3] = { 1, 2, 3 } // does not work