how data types in the Java programming language map to the data types in native programming languages such as C and C++,specifically -
chapter 3 of book "the java native interface programmer’s guide , specification",which says "the mapping of primitive types straightforward",i'm little confused sentence. know size of c data types uncertain,it depends on environment program run ,complie... such size of int type may 2 bytes or 4 bytes. size of java data types definite.the size of int 4 bytes.
so,how jni map data types between java , c/c++ clearly.
any answers appreciated!
well, in c, there module called stdint.h
defines types int64_t
, int32_t
, , friends, make mapping "straightforward."
but you're right note in particular implementation of c, size of plain old int
not specified exactly. author indeed pretty loose word "straightforward," , assuming read claim "java's int
maps c signed integer type of 32 bits."
Comments
Post a Comment