What data types can be passed between c++ and java/java to c++? Also, are the data types equivalent in terms of size?
3 Answers
Using Java Native Interface you can pass just about anything between C++ and Java.
3 Comments
Partial
and what about from java to c++?
Duck
JNI Supports both directions. It can be tricky and there may be better solutions for you but reading a little about JNI will answer many of your questions and is generally useful knowledge to have.
Tom Hawtin - tackline
JNA seems to be the popular slightly higher-level Java-native interface at the moment.
I prefer Swig myself. It does the JNI wrapping for you allowing calls in any direction you'd like, multithreading, etc. It also works with multiple languages including Java, Python, Perl etc...
Swig is also portable as your C++ code is - I use it myself on Linux and Windows to bridge our C++ code to Java and Python.