In one of my projects, I had the need to call a Java function from a C++ class and somewhat surprisingly it was more complicated than I initially expected it to be. Arguably there are more resources on how to call C++ functions from a Java class then the other way around. Also one needs to ensure that the documentation refers to calling Java from C++ instead of C , as there differences in the function calls. Hence based on my experience here's the solution that I came up with. Requirements I wanted a Java class to perform a certain task and return an array of double (primitive type). I would then invoke this Java method from my C++ class and use the values of that double array. A sample of my Java class public class Test{ public[] double array; public int size; public double[] getArray() { array = new double[]{1.2,3.2,1.2}; return array; } } Hurdles and initial mistakes Initially what I was trying was to...
Captain Danko’s JavaScript Lab — Tutorials, Frameworks & Front-End Mastery