C or C ++ and Java data type table

Java correspondence relationship between data types and C ++ (most available, a small part needs to be adjusted according to actual conditions)

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 and C data type table

Java Types of C type native performance
boolean int 32-bit integer (customizable)
byte char 8-bit integer
char wchar_t Platform-dependent
short short 16-bit integer
int int 32-bit integer
long long,__int64 64-bit integer
float float 32-bit floating point
double double 64-bit floating point
Buffer/Pointer pointer Platform-dependent (32 or 64-bit pointer)
pointer/array 32 or 64 bit pointer (the parameter / return value) abuts memory (structure member)
String char* / 0 the end of the array (nativeencodingorjna.encoding)
WString wchar_t* / 0 the end of the array (unicode)
String[] char** Array / 0 end of the array
WString[] wchar_t** Array / 0 end of the wide array of characters
Structure struct*/struct A pointer to a structure (parameters or return values)
(or is explicitly specified structure pointer) structure (structure member)
(or is explicitly specified structure)
Union union It is equivalent to the structure
Structure[] struct[] Array structure, adjacent memory
Callback (*fp)() Java or native function pointer function pointers
NativeMapped varies It depends on the definition
NativeLong long Platform-dependent (32 or 64-bit integer)
PointerType pointer And Pointer same

Guess you like

Origin www.cnblogs.com/jkguo/p/11262741.html