Search code examples
javajna

C char* to java String in JNA


I have function in C:

void MyFunc(char *value string);

I define it in JNA in Java like

void MyFunc(String value)

Is my definition good?


Solution

  • Yes, your definition is valid (except misprint in your C++ code, of course).

    Did you look at the JNA docs: https://jna.java.net/javadoc/overview-summary.html ? They perfectly specify what to use for each data type