Admin Production ni-theme
Current Publication

Variable Size

LabWindows/CVI

Options»Variable Size

The Variable Size command displays the number of bytes the variable consumes. If you declare the variable as a buffer, the variable size is the total size of the buffer. If you declare the variable as a pointer, the Variable Size command displays the number of bytes the pointer itself consumes and the number of bytes in the object that the pointer references. For example, if your code contains the following declaration:

static double y_array [4];

Variable Size displays a variable size of 32 bytes for y_array.

Assume your code defines dblPtr as follows:

static double *dblPtr;
dblPtr = malloc (2 * sizeof(double));

Variable Size displays a variable size of 4 bytes for dblPtr, pointing to 16 bytes (2 elements).