Hello friends.
Have searched the forum, but haven's found the answer.
I need to access a Java two dimensional array from C ( boolean[][] a; ).
Here's the code in C:
jbooleanArray aArray;
jboolean **a;
fid=(*env)->GetFieldID(env, cls, "a", "[[Z");
if (fid==0) { return; } aArray=(*env)->GetObjectField(env, jobj, fid);
len=(*env)->GetArrayLength(env, aArray);
a=(jboolean **) (*env)->GetBooleanArrayElements(env, aArray, 0);
Array lengths are correctly read separately. When I debug array in C it fails half-way or so:
for (i=0;i<arows;i++)
for (j=0;j<acols;j++)
printf("a[%d][%d]=%u ",i,j,a<i>[j]);
Error: An unexpected exception has been detected in native code outside the VM.
Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x189217B4
Is it the correct way to read multidimensional array? Or could it be the problem with jboolean type?
Kev