LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

out of bounds pointer error

Hi
 
when i run my cvi app, it pop-up error with this message:
Dereference of out-of bounds pointer: 1 bytes(1 elements) past end of array.
 
the relative code fo this error is
     for (i=0;i<32;i++)
          l_vArrayEGsmPwrCtrlLev[i]=l_vPwrCtrlLev[i];
and i  set the   variable declaration in *.h file for it is "int g_vArrayEGsmPwrCtrlLev[1][32]; "
 
Does anybody can help me?
thanks
crystal
0 Kudos
Message 1 of 2
(2,928 Views)
Hi Crystal:

I will assume that l_vArrayEGsmPwrCtrlLev and g_vArrayEGsmPwrCtrlLev are the same variable and the difference in names was a typo when posting this message. 

The problem is that you have declared g_vArrayEGsmPwrCtrlLev as a two-dimensional array here:
int g_vArrayEGsmPwrCtrlLev[1][32];
and in you're loop, you are indexing on the first dimension when you meant to index the second:
for (i=0;i<32;i++)
          l_vArrayEGsmPwrCtrlLev[i]
<- This dimension has a range of [0..1]. 

You probably meant:
          l_vArrayEGsmPwrCtrlLev[0][i]
----
I am the founder of CnCSoftwareSolutions. When not cleaning up baby drool, I write about test data or work on Vision, a tool for understanding your test data. Visit me at www.cncsoftwaresolutions.com
0 Kudos
Message 2 of 2
(2,908 Views)