加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > Java > 正文

Java和C的数据类型对照表

发布时间:2020-12-15 05:33:37 所属栏目:Java 来源:网络整理
导读:java的数据类型和C++的对应关系(大部分可用,小部分需要根据实际情况调整) C++ Java char * String word short byte byte byte[] byte[] dword int long NativeLong Void * Pointer lpvoid Pointer lpDword IntByReference HWND HWND char[] byte[] byte *

java的数据类型和C++的对应关系(大部分可用,小部分需要根据实际情况调整)

C++ Java
char * String
word short
byte byte
byte[] byte[]
dword int
long NativeLong
Void * Pointer
lpvoid Pointer
lpDword IntByReference
HWND HWND
char[] byte[]
byte * Pointer

Java和C的数据类型对照表

Java 类型 C类型原生表现
boolean int 32位整数(可定制)
byte char 8位整数
char wchar_t 平台依赖
short short 16位整数
int int 32位整数
long long,__int64 64位整数
float float 32位浮点数
double double 64位浮点数
Buffer/Pointer pointer 平台依赖(32或64位指针)
pointer/array 32或64位指针(参数/返回值)邻接内存(结构体成员)
String char* /0结束的数组(nativeencodingorjna.encoding)
WString wchar_t* /0结束的数组(unicode)
String[] char** /0结束的数组的数组
WString[] wchar_t** /0结束的宽字符数组的数组
Structure struct*/struct 指向结构体的指针(参数或返回值)
(或者明确指定是结构体指针)结构体(结构体的成员)
(或者明确指定是结构体)
Union union 等同于结构体
Structure[] struct[] 结构体的数组,邻接内存
Callback (*fp)() Java函数指针或原生函数指针
NativeMapped varies 依赖于定义
NativeLong long 平台依赖(32或64位整数)
PointerType pointer 和Pointer相同

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读