I want to map my C++ array output to jniFloatArray.
Tried to follow this solution:
"Convert float* to jfloatArray using JNI"
but I am unable to point float* to array object.
Let's say my output in C++ array output object is:
output = {1.0f ,2.0f ,3.0f};
What I really want is to convert or map this output (array) to jfloatArray in JniWrapper.
@Michael solved the problem. So by using output.data()
and setting float pointer to it as:
float *ptr = output.data();
solved the issue.