12-29-2013 01:19 AM
How to calc array length in Labwindows CVI ? In labwiew,I can find function to calc array length,but in CVI ,I can not ,...
12-29-2013 03:50 AM
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.
12-29-2013 04:27 AM
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 ...
12-30-2013 04:30 AM - edited 12-30-2013 04:32 AM
12-30-2013 04:44 AM
Hello 让一切随风
char *name ;
int length = 0;
int i = 0;
name = malloc(256) ;
strcpy(name , "National Instruments");
while( name[i] ! = "\0")
{
length ++;
i++
}
free(name);
05-09-2015 05:46 AM