Hello,
I have a dynamically allocated array. This array is of structure type. I have a conditional check to verify whether each element of this array was allocated with memory before performing further actions. I have palced the source code below.
Initially "ParaStructArray" is allocated with defined array size
ParaStructArray = (T_Data*) calloc(arraysize, sizeof(T_Data));
Later in one of my functions I have the validation check like this
if(&ParaStructArray[iVal] != NULL)
{
.... do something....
}
where iVal can range between 0 to arraysize.
In this case the validation passes if iVal is -1 or > arraysize and also in case if the ParaStructArray was freed.
Can I know whether there exists any function similar to _msize available in Borland compiler which can return me the information on the memory size in case of LabWindows/CVI? I would like to have memory size information of only a particular variable. Is there any other method I could use to overcome the problem?
Message Edited by Sreekantha on
01-15-2008 11:48 PM