文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>Jna Using Pointers and Arrays as int*

Jna Using Pointers and Arrays as int*

时间:2010-09-01  来源:jrvin

Primitive array arguments (including structs) are represented by their corresponding Java types. For example:

// Original C declarations
void fill_buffer(int *buf, int len);
void fill_buffer(int buf[], int len); // same thing with array syntax

// Equivalent JNA mapping
void fill_buffer(int[] buf, int len);

NOTE: if the parameter is to be used by the native function outside thescope of the function call, you must use Memory or anNIO Buffer. The memory provided by a Java primitive array will only be validfor use by the native code for the duration of the function call.

Arrays of C strings (the char* argv[] to the C main,for example), may be represented by String[] in Java code. JNAwill pass an equivalent array with a NULL final element.

相关阅读 更多 +
排行榜 更多 +
毒药轮盘手机版下载

毒药轮盘手机版下载

休闲益智 下载
剑侠情缘零b服手游下载

剑侠情缘零b服手游下载

角色扮演 下载
惊魂动物园游戏手机版下载

惊魂动物园游戏手机版下载

冒险解谜 下载