By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,549 Members | 1,717 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,549 IT Pros & Developers. It's quick & easy.

[JNI] how to modify a java array in the C++ code ?

P: n/a
in the java code :
byte [ ] aPictArrayUnpacked = new byte [ 3 ] ;

in the c++ code :
JNIEXPORT void JNICALL Java_tracker_UnpackPict (
JNIEnv * aEnv ,
jobject aObj ,
jbyteArray aPictArrayUnpacked )
{
jbyte * lBodyUnpacked = aEnv -> GetByteArrayElements (

aPictArrayUnpacked , 0 ) ;

memset ( lBodyUnpacked , 0 , 3 ) ;

aEnv -> ReleaseByteArrayElements (
aPictArrayUnpacked ,
lBodyUnpacked ,
0 ) ;
}

it crashes on the memset. what should I do ?

thanks
yomgui

Jul 17 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.