开发者

Does Java pass by reference or value to C when using JNI ( more specifically Android NDK)

开发者 https://www.devze.com 2022-12-10 09:05 出处:网络
Does Java pass by reference or value to C when using JNI 开发者_如何转开发( more specifically Android NDK)It depends on the type. Primitive types are passed by value and reference types by... referenc

Does Java pass by reference or value to C when using JNI 开发者_如何转开发( more specifically Android NDK)


It depends on the type. Primitive types are passed by value and reference types by... reference. See http://java.sun.com/docs/books/jni/html/types.html


I can't speak to Android, but JNI passes values just like Java does, primitive types are passed by value and all objects (including arrays) are passed by reference. The wiki article on JNI is pretty good.

0

精彩评论

暂无评论...
验证码 换一张
取 消