03-17-2014 06:55 AM
How to work with realloc function in CVI. When i am trying to reallocate structure,It is returning NULL value.
separatedVal = realloc( separatedVal ,(i+1) * sizeof(struct Separate));
here i am getting separatedVal = NULL
03-17-2014 07:44 AM
This is the expected behaviour in case realloc cannot allocate the needed space or in case requested size is 0. I suggest you to place a breakpoint on realloc line ans examine the value of 'i': if it's -1 resulting size will be 0 and the allocated memory pointed to by separatedVal will be freed.