I've got a problem: I must use an int java array in a C code. Using JNI
i wrote this code:
jsize len = (*env)->GetArrayLength(env, payload); //payload is the
name of java array
jint *body = (*env)->GetIntArrayElements(env, payload, 0);
int cpayload [len]; // C array
int i;
for (i=0; i<len; i++)
{
cpayload[i] = body[i]; // copying the java array value into C array
value
}
input.d_ip=0;
input.data_size=len;
input.data=(u_char)*body; //here there is the error
the compiler says this:
warning: assignment makes pointer from integer without a cast
P.S. data is define in this way:
u_char *data;