After memory allocation (calloc, malloc - see a very simple example
below) and using "View variable value - Shift F7" in CVI 6.0:
if size <= 2048 , the displayed number of array elements is equal to
size (everything is OK), but
if size >= 2049, the displayed number of array elements is:
(size *
😎 of elements for double and float array
(size * 4) of elements for int array
(size *2) of elements for short array
(size *1) of elements for char array
The size of allocated memory seems to be correct, only the "View
variable value - Shift F7" displays incorrect (bigger) number of array
elements than the real valid number.
In CVI 5.0, "View variable
value - Shift F7" displays always the correct
number of elements for any size and type of array. My OS is Win98SE.
Can somebody explain this fact? Have I neglected something new - an
option in CVI ver. 6.0?
Thanks
Jan Saliga
#include
#include
static double *array;
unsigned size= 2049;
int main (int argc, char *argv[])
{
if (InitCVIRTE (0, argv, 0) == 0)
return -1; /* out of memory */
array= (double *) malloc (size * sizeof(double));
//set breakpoint here a display variable "array"
free (array);
return 0;
}