From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How to calc array length in Labwindows CVI ?

How to calc array length in Labwindows CVI ? In labwiew,I can find function to calc array length,but in CVI ,I can not ,...

0 Kudos
Message 1 of 6
(6,100 Views)

Hello 让一切随风,

 

Is your array dynamically allocated? If it's not, you can find the length like so:

 

int c[25];

int size_c = sizeof(c) / sizeof(int);

 

Best regards,

= Nelu F. || National Instruments.

 

0 Kudos
Message 2 of 6
(6,095 Views)

The solution you give can use in program preprcessing period, but in program run period,for example,array first address(Pointer) is known,how to calc  the length of array ? thanks ...

 

 

0 Kudos
Message 3 of 6
(6,087 Views)

Hello 让一切随风,

 

are you using Link list program?

0 Kudos
Message 4 of 6
(6,038 Views)

Hello 让一切随风 

 

 

char  *name ;                              

int length = 0;

int i = 0;

 

 name = malloc(256) ; 

 

strcpy(name   , "National Instruments");

 

while( name[i] ! = "\0")

{

  length ++;

i++

}

 

free(name);

 

 

 

 

 

0 Kudos
Message 5 of 6
(6,034 Views)
I want from C# to labwindows/cvi,i have some problem in the code,please help me correct wrong.thanks!
0 Kudos
Message 6 of 6
(4,302 Views)