Help with ArraySize
Hi,
I know this is quite basic, but I have a doubt on ArraySize function; does it return the size of the array or the number of non-null elements in the array?
For example:
double array[];
ArrayResize(array,100);
array[0]=4;
array[1]=4;
array[2]=4;
int size=ArraySize[array];
In this case, will ArraySize function return a value of 3 (number of non-null elements), or a value of 100 (the actual size of the array)?
Many thanks!
A simple test will give you the answer. It returns the number of elements.
Be aware that with multi dimension arrays it will return the total elements for all dimensions. In this case if you want the number of elements in a dimension, you must use ArrayRange()
Try to print an uninitialized element.
Hi,
I know this is quite basic, but I have a doubt on ArraySize function; does it return the size of the array or the number of non-null elements in the array?
For example:
double array[];
ArrayResize(array,100);
array[0]=4;
array[1]=4;
array[2]=4;
int size=ArraySize[array];
In this case, will ArraySize function return a value of 3 (number of non-null elements), or a value of 100 (the actual size of the array)?
Many thanks!