How to convert a jstring to a C-style string or vice versa?

The jstring type represents strings in the Java virtual machine, and is different from the regular C string type (a pointer to characters, char *).  So we cannot use a jstring as a normal C string. We must use the appropriate JNI functions to convert jstring objects to C/C++ strings.  The JNI supports conversion both […]