LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

get size of double array?

Solved!
Go to solution

Hi,

 

Are double arrays able to contain null values? Also, what is the double array equivalent to strlen( )?

 

Sorry for the noobish questions!

 

Thanks

0 Kudos
Message 1 of 6
(7,485 Views)

Hi,

 

If you mean NULL, remember that NULL is defined as ((void *)0), i.e. a pointer. 

 

If you want to obtain the size of an array, you can use sizeof ( array ) / sizeof ( double ).

 

Hth,

 

Wolfgang 

0 Kudos
Message 2 of 6
(7,481 Views)

Or more generically

 

sizeof(array)/sizeof(array[0]);

Message 3 of 6
(7,478 Views)

My apologies, that is very helpful, but what I meant to ask is how would I query the amount of elements in a double array?

 

for example:

 

double rhoArray[]={.118,.040,.025,.014,.007,.005,.004,.003,.002,.002,.003,.005,.012,.016,.020,.023,.021,.020};

numElements = strlen(rhoArray);

 

0 Kudos
Message 4 of 6
(7,396 Views)
Solution
Accepted by TurboMetrologist

I'm not sure what you're asking.

 

sizeof(array) tells you how much space the entire array takes.

sizeof(array[0]) tells you how much space one array element takes.

sizeof(array) / sizeof(array[0]) tells you how many elements are in the array.

 

Anything else?

0 Kudos
Message 5 of 6
(7,393 Views)

}

 

0 Kudos
Message 6 of 6
(5,119 Views)